Wireless LED driver with PCA9634 II – PC application

pca964bbheaderI wrote about PCA9634 wireless driver with IQRF last week. Today I published specific software for register setup. You can use this software for registers value debugging. Application is not finished yet, some features are planed in future.

PCA9634driver is written in C# language. You need .NET 3.0 framework or higher, .NET 4.0 framework is recommended. This application uses PC serial port or USB to serial port converter interface. Just use UART-link example for connected TR module.

pca9634app

TR module connected to PCA9634 has to be updated with new user code. Now we have two control packets.

0x12, 0x23, ‘S’, REG_ADDR, REG_DATA  (DLEN = 5) – set Register (write operation)

0x12, 0x23, ‘R’, REG_ADDR, REG_DATA  (DLEN = 5) – read Register (read operation)

Please note, that “R” packet has different function from previous post. There is main part of updated user code.


while (1)   // main loop
{
   if (RFRXpacket()) 
   {
      if(DLEN == 5) // Check length
      {
         pulseLEDG();

         // check address
         if (bufferRF[0] != ADDRESS_HI) continue;
         if (bufferRF[1] != ADDRESS_LO) continue;
				
         if (bufferRF[2] == 'S') // Set register
         {
             // Write register
             PCA9634_WriteReg(bufferRF[3],bufferRF[4]);
             pulseLEDR();
         }
				
         if (bufferRF[2] == 'R') // Set register
         {
             // Write register
             bufferRF[4] = PCA9634_ReadReg(bufferRF[3]);
             pulseLEDR();
             DLEN = 5;
             PIN = 0;
             RFTXpacket();
         }				
      }
   }
}

Enjoy.

 

Download Attachments

Leave a Reply

Your email address will not be published. Required fields are marked *