Port of FreeModbus to LPC11xx

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Port of FreeModbus to LPC11xx

1,194 Views
wiktor_sleziak
Contributor I

Hello,

I am working on a temperature measurring device. Currently, I must do a communication with PC. UART is working great, I can send and receive any strings. Main goal is use a Modbus RTU protocole and I got stuck with this.

I am using a LPC241x demonstration project from freemodbus-v1.5.0 to convert for my program. I changed all VIC interrupts function to NVIC in portserial.c, porttimer.c and portevent.c. Also I modfied port.c and I used portmacro.h. After compilation i get no errors, but when  I start Modbuss Poll,  finally I am getting a nothing.

I have hope that someone help with this subject.

/* ----------------------- Start implementation -----------------------------*/
int
main( void )
{
   eMBErrorCode eStatus;

   eStatus = eMBInit( MB_RTU, 0x0A, 0, 38400, MB_PAR_EVEN );

   /* Enable the Modbus Protocol Stack. */
   eStatus = eMBEnable( );

   for( ;; )
   {
      ( void )eMBPoll( );

      /* Here we simply count the number of poll cycles. */
      usRegInputBuf[0]++;
   }
}

0 Kudos
2 Replies

798 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi

can you please confirm the part number that you are using?

Regards

Vicente

0 Kudos

514 Views
xueyuquan
Contributor I

I am working on a temperature measurring device. Currently, I must do a communication with PC. UART is working great, I can send and receive any strings. Main goal is use a Modbus RTU protocole and I got stuck with this.

I am using a LPC1111 demonstration project from freemodbus-v1.6 to convert for my program. I changed all VIC interrupts function to NVIC in portserial.c, porttimer.c and portevent.c. Also I modfied port.c and I used portmacro.h. After compilation i get no errors, but when  I start Modbus Poll,  finally I am getting a nothing.

I have hope that someone help with this subject.

0 Kudos