Learning about microcontrollers - Page 1
Forum section: electronics / general

author: Randall W. Lott
author_rank: Regular Contributor
timestamp: March 22, 2012, 08:41:15 pm
content: Are there any good resources online regarding how to use microcontrollers with perepherals such as; LCDs, Ethernet, USB, and wireless technologies?I have experience with the Motorolla 68HC11. I understand its registers and respective assembly language. Granted, it may be older than me!I own an Arduino Duemilanove and I understand C++.My goal is to use a single chip to communicate with my PC and update a database given conditions presented on the PCB.Thank you.

author: Dago
author_rank: Frequent Contributor
timestamp: March 22, 2012, 08:49:33 pm
content: I think the arduino website is a good starting point.http://arduino.cc/en/Tutorial/HomePageThere are lots and lots of tutorials and websites that deal with stuff you mentioned but you could be a bit more specific. Like "LCDs" contains everything from using HD44780 -based text-LCDs to graphical color LCDs with high-speed data buses which are quite a bit different kind of beasts. Wireless technologies contain everything from bluetooth and wifi to simple radiolinks.

author: kd7eir
author_rank: Unknown
timestamp: March 23, 2012, 03:10:03 am
content: I have found that a Google search for arduino + (insert device here) will return more hits than enough information.

author: ChrisW
author_rank: Contributor
timestamp: March 23, 2012, 05:40:19 am
content: LCD'sWireless-Chris

author: Randall W. Lott
author_rank: Regular Contributor
timestamp: March 23, 2012, 06:58:08 am
content: Thank you. I'll start there.I've googled UART, ISP, I2C, and such. I still only understand serial and parallel as black and white. From my understanding, UART is a serial bus that sends and receives through shift-registers? The data would need to be temporarily stored due to its asynchronous nature.When a device claims to have "serial I/O", does it mean that it will always work with UART as long as the logic levels and baudrates match? Some products, such as sensor modules, only mention "serial" and don't claim it to be synchronous or not. This is confusing to me.I've studied digital electronics up to state machines, multiplexers, shift registers, programmable logic, counters, flip-flops, and decoders.

author: Bored@Work
author_rank: Super Contributor
timestamp: March 23, 2012, 07:36:31 am
content: Quote from: Randall W. Lott on March 23, 2012, 06:58:08 amNo, UART, or USART, as it is named in the AVR, is a piece of hardware for driving a class of serial buses, the RS232 bus being the most prominent. In case of the AVR the U(S)ART is build into the AVR. While in the old days it was a separate IC. This articlehttp://en.wikibooks.org/wiki/Serial_Programming/Typical_RS232_Hardware_Configurationexplains the principles. The article is not AVR specific.The presence of a UART in some setup typically indicates you can at least do RS232, maybe other similar buses, too. But as you can see in the mentioned article, having a UART is not enough. While the other stuff, baud rate generator and the like, is e.g. build into an AVR, the required level converter is not.QuoteSynch and asynch just describe where the clock for the bus is derived from. Synch means the partners in the communication are synchronized via a separate clock signal. Asynch means they synchronise each other from the data signal.It is not the asynchronous nature that requires the storage. It is the serial one, the need to convert a piece of data, a byte, into a series of bits, to be send over the serial bus one after the other. Because you send the bits one after the other, and not all at once, you need to keep (store) the bits until it is their time to be sent.QuoteNo, "serial I/O" is a generic term. It can mean all sorts of serial buses, protocols and voltage levels. You have to derive from the context if they are talking about a specific bus, e.g. often they mean RS232, but maybe with TTL level only, or they mean SPI, or I2C or whatnot if they just talk about general capabilities.QuoteSynch or asynch is not the key issue here. The bus type as such is. Synch or asynch is just one property of many a particular bus has. If you know the bus, you now if it is synch or asynch.To identify the bus you need to read the data sheet. One thing to keep in mind is that several serial busses, like I2C or SPI were or are proprietary. Sometimes only the name of the bus is a trademark. Device manufacturers try to avoid license fees by implementing a "compatible" bus, and not mentioning the trademarks in the documents. E.g. I2C is often called TWI, because Philips/NXP owns (owned?) I2C. So it helps to know the alternative names, and it helps to know how a particular bus functions, to be able to recognize it in a datasheet.

author: Randall W. Lott
author_rank: Regular Contributor
timestamp: March 23, 2012, 05:03:13 pm
content: "While the other stuff, baud rate generator and the like, is e.g. build into an AVR, the required level converter is not."I noticed that some chips state TTL level UART and others say LVTTL level UART. Can I assume that the baudrate will be automatically set and I will simply need a bi-directional translator (level converter)? I know that TTL runs at 0-5V and LVTTL runs at 0-3.3V.It would be simple to use a voltage divider for the 5V to 3.3V buck, but I kept away from it due to problems at higher rates, although I'm sure it won't be running at concerning speeds.Are there any easy ways to identify compatibility or do I just need to suck it up and use a translation IC?Thank you dearly for your time and effort. Take care.

author: Bored@Work
author_rank: Super Contributor
timestamp: March 23, 2012, 06:53:56 pm
content: Quote from: Randall W. Lott on March 23, 2012, 05:03:13 pmThe baud rate and a few other communication parameters need to be programmed. AVRs have usable defaults, i.e. when an AVR comes out of reset things like number of data bits, parity, stop bits are set to the common 8N1. Therefore in simple setups the programming of some parameters can be skipped. Although I usually do it. Baud rate, the AVR uses a divider for setting it, should always be programmed, because it depends on the system clock, the clock to be divided. Interrupts might be programmed, too.QuoteFor real RS232 you should use a dedicated RS232 converter. MAX232 or MAX3232 are very popular among hobbyists.For connecting a 5V to a 3.3V system it depends on the systems. Some 3.3V systems are 5V tolerant and voltage levels might still be within TTL tolerance. For others you need level converters.