SCREENSHOT 2. As Def Leppard would say, “Fo Fo Fo Fo Foolin.”
with LED 2 — which remained dark. With the hardware on
the PICDEMZ and PIC24FJ/PIC32MX Trainer side seeming to
be attempting to send and receive packets, I turned my
attention back to the Mi Wi main.c function.
#if defined(__PIC24F__)
// PIC24FJ/PIC32MX Trainer
_CONFIG2(FNOSC_PRI & POSCMOD_XT)
// Primary XT OSC no PLL
_CONFIG1(JTAGEN_OFF & FWDTEN_)
// JTAG off, watchdog timer off
#endif
With no 4x PLL specified in the ConfigFuses.c code, the
CPU fuse is blown to disable the PLL and the CPU is indeed
clocking at 8 MHz. A few clicks on the keyboard will fix
that:
#if defined(__PIC24F__)
// PIC24FJ/PIC32MX Trainer
_CONFIG2(FNOSC_PRIPLL & POSCMOD_HS)
// Primary HS OSC with 4x PLL
_CONFIG1(JTAGEN_OFF & FWDTEN_OFF)
// JTAG off, watchdog timer off
#endif
After a quick recompile and program operation, things
perked up considerably. The PIC24FJ/PIC32MX Trainer took
on a whole new attitude and began to respond without
having to be prodded and reset. However, I still could not
illuminate the Trainer’s LED 2 from the End Device.
Along the way, I noticed that the coordinator’s RS-232
messages were not being sent. That told me that the
payload bytes that toggle the LED were never being
processed. In most cases, that points to an addressing
problem. During the time I spent sweating over the main.c
code line by line, I recall seeing an address string that was
also appearing in the unsuccessful data packets that were
flowing in the ZENA captures. Here’s the main.c code
snippet I’m referring to:
// if no socket, send report by long or short
// address alternatively
if( (transmitMode++ 2) == 0 )
{
tempLongAddress[0] = 0x07;
tempLongAddress[1] = 0x06;
tempLongAddress[2] = 0x05;
tempLongAddress[3] = 0x04;
tempLongAddress[4] = 0x03;
tempLongAddress[5] = 0x02;
tempLongAddress[6] = 0x01;
tempLongAddress[7] = 0x55;
SendReportByLongAddress(tempLongAddress);
ConsolePutROMString((ROM char*)”Send
Report by Long Address\r\n”);
}
SCREENSHOT 3. Success! The LED illuminated. The new address is embedded in the Mi Wi demo firmware and that’s what the
application is looking for.
72 SERVO 06.2010