This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2553: RS485 communication using MAX485

Part Number: MSP430G2553

Hi

I am developing an application involving a temperature sensor where the microcontroller i.e. msp430g2553 takes data from the sensor via I2C and transmits the same to HMI panel through RS485 protocol.

I am using a MAX485 IC to convert serial to RS485 protocol. I would like to know if i have to make any changes to code or MAX485 will take care of the protocol.

a=temp/100;
b=(temp-a*100)/10;
c=(temp-a*100-b*10);

UCA0TXBUF = (a & 0xff) + 0x30;
while(!(IFG2 & UCA0TXIFG));
UCA0TXBUF = (b & 0xff) + 0x30;
while(!(IFG2 & UCA0TXIFG));
UCA0TXBUF = (c & 0xff) + 0x30;
while(!(IFG2 & UCA0TXIFG));
UCA0TXBUF =' ';
while(!(IFG2 & UCA0TXIFG));

Please note that i am tranferring one digit at a time. Ex: if temp is 23, then i transfer 2 and then 3.

**Attention** This is a public forum