Hi again, seems no one has replied the topic, seems understandable knowing that I had some things I could find out by myself. I'll explain what I have done and the new issue I have found.
I'd like to remember the tools I'm working with:
- PAN802154HAR target (don't freak out please, just see it as a custom target). It uses a MC13192 as transceiver and a MC9S08GT60 as MCU. PAN802154HAR target is based on the SARD design.
- I started working with BeeKit but I found out that it was better to start with MAC examples.
Before jumping into the configuration of the "User Defined Target Editor", I'd like to say too that I solved the two doubts of my last post. PAN802154HAR target uses only one SCI and it doesn't use RTS/CTS lines (which are used to implement multiple SCIs), those ports will remain as N/A then. PAN802154HAR target has an external dual antenna, it means that the antenna switch port used for single anntena cases is no needed, so, it will remain as N/A too.
I found that, in order to use a PAN802154HAR target, you must set the Pin 6 of the Port C to high. Why? because it is used to put the RS-232 IC into sleep mode, if you don't set it to high it will start slept because "User Defined Target Editor" default value for that pin is low. These are the correct hexadecimal values you must set at the right side of the editor: Port C Register: 0x48 and Port C Data Direction Register 0x5C. Once done that you will see UART messages in the Hyperterminal.
Here is a screenshot of the "User Defined Target Editor" configuration:
http://img174.imageshack.us/img174/2840/configyq0.jpg(Note. It may not be the final configuration, more info at the end of this post)
Star Network Demo uses a switch input to start the ED scan and to start the PAN network as well, however, it wont work if you don't go to specific code lines and perform some modifications:
at PWRLib.c you find this:
Code:
#if (cPWR_KBIInitAndVectorEnable)
#if (cPWR_KBIWakeupEnable)
KBI1PE = cKBI1PE;
KBI1SC = cKBI1SC | cKBI1SC_Ack;
#endif
#endif
PWRLib_MCU_WakeupReason.AllBits = 0;
and at PWR_Configuration.h you find that cPWR_KBIInitAndVectorEnable is by default 0, it means that the target will have disabled the KBI. You gotta set that cPWR_KBIInitAndVectorEnable to 1.
I also added PWRLib_MCU_WakeupReason.Bits.FromKBI = 1; inside that second if. If KBIWakepEnable is true (which is) it needs a reason to wake up. Finally I commented the instruction PWRLib_MCU_WakeupReason.AllBits = 0; that is at the end of the first if. Shouldn't be there.
Here is how it should look like:
Code:
#if (cPWR_KBIInitAndVectorEnable) #if (cPWR_KBIWakeupEnable) KBI1PE = cKBI1PE; KBI1SC = cKBI1SC | cKBI1SC_Ack; PWRLib_MCU_WakeupReason.Bits.FromKBI = 1; #endif #endif //PWRLib_MCU_WakeupReason.AllBits = 0;
There is another "stone in the shoe" for PAN802154HAR target users. At PWR_Configuration.h you find:
Code:
#define cKBI1PE 0b00010000 // Only PTA4 = S103 interrupt
PAN802154HAR target uses the Pin 2 of the Port A (PTA2) for its only switch. So, you must change that for 0b00000100.
Once you perform those modifications, you will be able to run MAC examples in your PAN802154HAR. However, it stops again with one known issue, brough by several forum users like Alex-RUS at:
http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&message.id=3772http://forums.freescale.com/../view_profile?user.id=4688" rel="nofollow" target="_blankStar Network Demo starts well. Here is a log of the Coordinator's Hyperterminal:
"Press any switch on board to start running the application.
MyStarNetworkDemo-Coordinator application is initialized and ready.
Initiating the Energy Detection Scan.
Sending the MLME-Scan Request message to the MAC... Done.
Received the MLME-Scan Confirm message from the MAC.
ED scan returned the following results:
[ 88 00 00 00 00 00 00 88 88 00 00 00 00 00 00 00 ].
Based on the ED scan the logical channel 0x0C was selected.
Starting as PAN coordinator on channel 0x0C
PAN Coordinator started.
Sending the MLME-Start Request message to the MAC Done.
Started the coordinator with PAN ID 0xBEEF, and short address 0xCAFE.
Ready to send and receive data over the UART."
Then, End Device's Hyperterminal shows:
Press any switch on board to start running the application.
"MyStarNetworkDemo-EndDevice application is initialized and ready.
Start scanning for a PAN coordinator.
Sending the MLME-Scan Request message to the MAC... Done.
Scan did not find a suitable coordinator.
Start scanning for a PAN coordinator.
Sending the MLME-Scan Request message to the MAC... Done.
Scan did not find a suitable coordinator.
Start scanning for a PAN coordinator.
Sending the MLME-Scan Request message to the MAC... Done.
Scan did not find a suitable coordinator." ... and so on.
I went to NV_Data.c and I found:
Code:
#ifdef TARGET_TOROWEAP TRUE, /* uint8_t useDualAntenna; */ #elif gTarget_UserDefined_d gUseExternalAntennaSwitch_c,#else FALSE, /* uint8_t useDualAntenna; */#endif /* TARGET_TOROWEAP */
Why is there only a TARGET_TOROWEAP option? I tried adding TARGET_USER_DEFINED one but it didn't work. I also tried forcing this value TRUE without luck. Why with gTarget_UserDefined_d it goes to gUseExternalAntennaSwitch_c? knowing that some targets don't use it? I tried skipping it, didn't work.
Seems that gTarget_UserDefined_d is well setted but didn't find where.
I'm hoping for a little of help here, since I came to this point by myself. My target uses a PCB dual antenna, I'm guessing it doesn't use a external antenna switch since MC13192 documentation says it is used for single antennas, does it mean that my target is using an internal antenna switch?. What else should I config or change to get the End Device joining the PAN network made by the Coordinator?
If there is something I'm missing please let me know.
Thanks for your help.
Message Edited by neocronos on
2008-03-19 02:39 AMMessage Edited by neocronos on
2008-03-19 02:40 AMMessage Edited by neocronos on
2008-03-19 02:41 AM