AnsweredAssumed Answered

start STM32W108 module zigbee

Question asked by Hibiscus on Mar 1, 2013
Latest reply on Mar 20, 2013 by Hibiscus
Hi, 

I'm new in that technology and this microcontroller. 

I want to program my zigbee module in order to send me a "hello world" message through UART. 

I have connect my module with STM32W108 ucontroller with a dsPIC. My dsPIC have 2 uarts, UART1 I've configured to comunicate to my Pc and UART2 to comunicate with Zigbee. 

I've programmed the following code in my dspic:

void ZigProgram(){
     char CaracterRebut;


     if (nBOOTMODE == 0){ //estem en mode bootloader, de programació. 
          sprintf(sTxt, "0x7F"); //commanda d'iniciació
          putsUART2((unsigned int *)sTxt);
          while (BusyUART2()); // M'espero mentres es transmet


          while (UartTincDada2 () == 0); //mentre no rebo res m'espero
          // si surto, és perquè tinc dades
          UartPintaDada2 ();
          CaracterRebut = UartReturnBuf_Rx2 ();
          if (CaracterRebut == 0x79){
               sprintf(sTxt, "\r\n CaracterRebut és 0x79 \r\n");
               putsUART1((unsigned int *)sTxt);
               //ACK ok. Puc començar a demanar coses
               sprintf(sTxt, "0x00"); //command Get. 
               putsUART2((unsigned int *)sTxt);
               while (UartTincDada2 () == 0); //mentre no rebo res m'espero
               // si surto, és perquè tinc dades
               //CaracterRebut = UartReturnBuf_Rx2 ();
               UartPintaDada2 ();
          }else{
               //error. NACK?
               sprintf(sTxt, "\r\n CaracterRebut és 0x%x \r\n", CaracterRebut);
               putsUART1((unsigned int *)sTxt);
          }
          nBOOTMODE = ON; //el torno a pujar
     }else{
          sprintf(sTxt, "\r\n nBOOTMODe val on \r\n");
          putsUART1((unsigned int *)sTxt);
     }
}

In order to program it. So, I initialize with nBOOTMODE pin (from dsp) in '0'. My UART2 is configurated with a baudrate 115200, even parity, 8 bits, 1 stop bit. 

Always I recieved a pulse train from Zigbee. What it means? 

Does anybody know what I do wrong? I know this is complicated, but does anybody have a started C code to program it?

Thanks in advance!

Outcomes