Dear All,
can anybody tell me whether rs485 and i2c (both) is possible with msp430g2153 or not.
thanks
regards
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.
Dear All,
can anybody tell me whether rs485 and i2c (both) is possible with msp430g2153 or not.
thanks
regards
The two parts of the USCI can work simultaneously, so teh USCIA can do the UART job (for RS485 signalling and handshake, you'll have to add addintional hardware, such as the MAX485, and software for controlling the direction) while the USCIB part can at teh same time do I2C. And teh signals are on different port pins too.Rahul Gupta said:can anybody tell me whether rs485 and i2c (both) is possible with msp430g2153 or not.
However, I2C will conflict with an attached JTAG, so you can only use SBW when you have the I2C pins in use or connected to I2C devices.
Thank you sir for your reply.........
Actually sir i want to use MSPg2153 and Tsl235(light to frequency sensor)
the output of this sensor has to be connected to my mspG2153, WHICH PIN Would BE SUITABLE to connect this sensor as i have to calculate the input frequency(output of sensor will be square wave)
whats could be the proceedure to calculate frequency.........
after calculating frequency the data has to be transfered through UART(rs485) to computer.
could u tell me the proceedure to acheive above?
Thanks
regards
Basically every I/O pin. But I'd suggest using apin that is input to a CCR unit. If oyuprogram a timer, e.g. to be clocked with 1MHz, and set up the CCR unit belonging to your signal pin into capture mode, the CCR unit will trigger an interrupt each tiem it detects an edge and also freeze the current timer value. Inside the ISR you can determine with a resolution of 1µs how far the two edges were apart by buildign the difference of the current and the last reading. With 1MHz timer clock, your maximum detectable frequency will be 500kHz (but then, your code might be too slow to catch up with this, even if your CPU clock is 16MHz), and the lowest frequency will be 16Hz, as the tiemr will overflow after 65536 ticks.Rahul Gupta said:WHICH PIN Would BE SUITABLE to connect this sensor
The conversion from period time to frequency is best done using a lookup table, as divisions (the 1/t calculation) are slooow.
For RS485 output you'll need an external RS485 driver such as MAX485. Also, you'll need to implement a logic for the direction control, as RS486 is half-duplex. For the data transfer itself, the USCI module in the G2153 does this job in UART mode. There are plenty of forum threads and code examples available avout this.
**Attention** This is a public forum