XMC4500 Modbus

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi everybody,

I'm a beginner with Infineon microcontrollers and Modbus. I'm trying to acquire data from a XMC 4500 with serial Modbus protocol (9600 8 N 1); I also use a USB-RS232 converter and a Modbus Master program.
I know that read only variables are stored in registers 0x100 to 0x1FF and read/write variables from 0x200 to 0x2FF. When I try to read them with specific functions I can't see anything except of zeros, while registers should contain a certain value. But in registers from 0 to 9 I read random values.
Am I doing something wrong? Does anybody ever dealt with this problem and knows how to manage it?

Apologize me if the question may sound stupid, but I can't get through it.

Thanks in advance for any advice.

Andrea.
0 Likes
3 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
So sorry that I have not really tried ModBus protocol. Can you check if you can receive data from the UART (RS232)?
0 Likes
Not applicable
Thank you Travis for your reply.

I tried with an oscilloscope to test pins 1.4 and 1.5 to see if by sending a packet to Rx pin I could receive a back packet answer over Tx pin.
I can see a reply from the micro only when I establish a connection with the board on which it is assembled. While when I send a command in order to read registers I can't get any reply.
How can I test the UART? I'm using Dave 3.1.
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
AndreaB93 wrote:
Thank you Travis for your reply.

I tried with an oscilloscope to test pins 1.4 and 1.5 to see if by sending a packet to Rx pin I could receive a back packet answer over Tx pin.
I can see a reply from the micro only when I establish a connection with the board on which it is assembled. While when I send a command in order to read registers I can't get any reply.
How can I test the UART? I'm using Dave 3.1.


Seems like you can see both transmit and receive on the scope. You can check the UART receive buffer to see if you had received the correct data. If the microcontroller is able to do both transmit and receive, then the problem might be on the MOD bus software stack.
0 Likes