12.07.2015 Views

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RS232 communication explainedRS-232 (Recommended Standard 232) is the traditional name for a <strong>se</strong>ries of standards for <strong>se</strong>rialbinary data and control signals connecting between a processor and peripheral circuits andmachines. It is commonly u<strong>se</strong>d in computer <strong>se</strong>rial ports but modern microcontrollers also have oneor more UART’s – capable of communicating with other RS232 devices.RS232 has been u<strong>se</strong>d for many years, and in spite of new standards like CAN – RS485 and I2C toname some – is still very popular and widely u<strong>se</strong>d.Features:• U<strong>se</strong>s 2 pins – TX (transmit) and RX (receive) + gnd• Asynchronous – no <strong>se</strong>parate clock signal is transmitted• Asynchronous signals means that transmitter and receiver need exactly the same <strong>se</strong>ttings:o Baud rate (1200bps – 9600bps…)o Parity control (yes – no – even – odd)o Stop bits (0-1-2)o Voltage levels (+/-12V or TTL)o Number of data bits (5-6-7-8…9)Most modern microcontrollers have a UART embedded in the controller. This UART - after correctconfiguration – will take care of all the complex timing and other RS232 tasks – in the background.Programmers just need to feed them with data to be <strong>se</strong>nt or read out and clear the receive bufferwhen new data has been received.For microcontrollers without an embedded UART – there is also the possibility to <strong>se</strong>t up a RS232communication – entirely in the software. This is called a bitbanged UART and this is more complexto program and will take more of the resources of the microcontroller away.Bart Huyskens <strong>Manual</strong> <strong>Elektor</strong> <strong>Proton</strong> V1.0 3 April 2011 89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!