Cerburino Bee

Hi,

first of all I would like to say that I am very happy with my Panda II! The Cerburino Bee, instead, drives me crazy.
My aim is to make the Cerburino Bee communicate with RFM12s via SPI. As you can see in the two attached images, the signal from the clock (SCK) comes too early and is irregular. Moreover the frequency is 333 kHz instead of 1 mHz. The first image shows the Panda II and the second the Cerberus Bee.
Does anyone have the same problem?
Here are my communication parameters:

Cerbuino Bee:
static SPI.Configuration m_SPIConfig = new SPI.Configuration((Cpu.Pin)FEZCerberus.Pin.PA15, false, 0, 0, false, true, 1000, SPI.SPI_module.SPI1);
static SPI m_RFM = new SPI(m_SPIConfig);

Panda II:
static SPI.Configuration m_SPIConfig = new SPI.Configuration((Cpu.Pin)FEZ_Pin.Digital.Di10,false, 0, 0, false, true, 1000, SPI.SPI_module.SPI1);
static SPI m_RFM = new SPI(m_SPIConfig);

I hope somebody can help me!
Thank you in advance,

Italo

IIRC, there was something similar in earlier version. Do you have the latest firmware? MFDeploy shows the version under device capabilities.

Welcome to the community.

Pinging… TinyCLR
HalSystemInfo.halVersion: 4.2.0.0
HalSystemInfo.halVendorInfo: Copyright GHI Electronics, LLC
HalSystemInfo.oemCode: 255
HalSystemInfo.modelCode: 0
HalSystemInfo.skuCode: 65535
HalSystemInfo.moduleSerialNumber: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
HalSystemInfo.systemSerialNumber: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
ClrInfo.clrVersion: 4.2.0.0
ClrInfo.clrVendorInfo: Copyright GHI Electronics, LLC
ClrInfo.targetFrameworkVersion: 4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.3.3
SolutionReleaseInfo.solutionVendorInfo: Copyright © GHI Electronics, LLC
SoftwareVersion.BuildDate: Nov 19 2012
SoftwareVersion.CompilerVersion: 410462
FloatingPoint: True
SourceLevelDebugging: True
ThreadCreateEx: True
LCD.Width: 0
LCD.Height: 0
LCD.BitsPerPixel: 0
AppDomains: True
ExceptionFilters: True
IncrementalDeployment: True
SoftReboot: True
Profiling: False
ProfilingAllocations: False
ProfilingCalls: False
IsUnknown: False

Create TS.

Loading start at 805b980, end 808459c

Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Graphics (4.2.0.0) Assembly: Microsoft.SPOT.TinyCore (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0) Assembly: Microsoft.SPOT.IO (4.2.0.0)
Assembly: System.IO (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)
Assembly: Microsoft.SPOT.Net (4.2.0.0) Assembly: System (4.2.0.0) Loading Deployment Assemblies.

Attaching deployed file.

Assembly: GHIElectronics.Gadgeteer.FEZCerbuinoBee (1.1.1.0) Attaching deployed file.

Assembly: GHI.OSHW.Hardware (4.2.3.1) Attaching deployed file.

Assembly: Gadgeteer (2.42.0.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Net.Security (4.2.0.0) Attaching deployed file.

Assembly: Gadgeteer.SPI (2.42.0.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Touch (4.2.0.0) Attaching deployed file.

Assembly: System.Http (4.2.0.0) Attaching deployed file.

Assembly: System.Net.Security (4.2.0.0) Attaching deployed file.

Assembly: RMF12_SEND (1.0.0.0) Resolving.

The debugging target runtime is loading the application assemblies and starting execution.
Ready.

Can you please provide us with simplest code you have that shows this problem? What surprises me is that Cerberus use SPI for networking and that works fine!

Hi Gus,

thx for your help and time. Here is the simple code for init the RFM12.

Greatings form Germany…

using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics;
using GHI.OSHW.Hardware;
using GT = Gadgeteer;

namespace RMF12_SEND1
{
    public partial class Program
    {
        static SPI.Configuration m_SPIConfig = new SPI.Configuration((Cpu.Pin)FEZCerberus.Pin.PA15, false, 0, 0, false, true, 1000, SPI.SPI_module.SPI1);
        static SPI m_RFM = new SPI(m_SPIConfig);

        static InterruptPort _spiinterruptPort = new InterruptPort((Cpu.Pin)FEZCerberus.Pin.PA9, true,
           Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);

        void ProgramStarted()
        {
            // Hook up an event handler (delegate) to the OnInterrupt event 
            _spiinterruptPort.OnInterrupt += new NativeEventHandler(Spi_OnInterrupt);
            Debug.Print(RFXX_WRT_CMD(0x0000).ToString());
            RFM12_Init();         
        }

        public void SEND()
        {
        }

        public void Spi_OnInterrupt(uint port, uint state, DateTime time)
        {
        }

        public void RFM12_Init()
        {
            RFXX_WRT_CMD(0x80D8); // EL,EF,433band,12.0pF
            RFXX_WRT_CMD(0x8201); // Sleep
            RFXX_WRT_CMD(0xC611); // Speed of transmittion = 19200 bauds
            RFXX_WRT_CMD(0x9460); // frequency
            RFXX_WRT_CMD(0xC2AC);
            RFXX_WRT_CMD(0xCED4);
            RFXX_WRT_CMD(0xC483);
            RFXX_WRT_CMD(0x9880);
            RFXX_WRT_CMD(0xCC77);
            RFXX_WRT_CMD(0xE000);
            RFXX_WRT_CMD(0xC800);
            RFXX_WRT_CMD(0xC000);
        }

        public ushort[] _readBuf = new ushort[1];
        public ushort[] _writeBuf = new ushort[1];
        public ushort RFXX_WRT_CMD(ushort cmd)
        {
            _writeBuf[0] = cmd;
            m_RFM.WriteRead(_writeBuf, _readBuf);
            return (_readBuf[0]);
        }
    }
}