AnsweredAssumed Answered

Port of FreeModbus to LPC11xx

Question asked by Wiktor Śleziak on Feb 6, 2017
Latest reply on Feb 13, 2017 by vicentegomez

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]++;
   }
}

Outcomes