PhotoPhoto Windell Oskay
595 series shift registers come in many flavors. SN74HC595 is the most usual. TPIC6B595 is similar but can be used with more power hungry applications. Pin layouts are different but they all operate in the same way.
Shift register is controlled with three pins. They are usually called
CLOCK. Chip manufacturers have different names. See the table below for two examples from Texas Instruments.
PhotoPhoto Pete Prodoehl
I like to use various Arduino boards for AVR development. What I do not like are the Arduino libraries. They are often just wrappers around libc functions or rewrites of functions libc already provides. Serial communications is one good example. Arduino provides you with its own implementation of
Serial.read() methods. At the same time AVR Libc has proven
getchar() functions. This article explains easy implementation of libc functions used for serial communications.
AVR microcontrollers have three control and status registers. Register
UCSR0A mostly contains status data.
UCSR0C contain all the configuration settings. See the tables in the end of article for all possible values.
AVR Libc provides helper macros for baud rate calculations. Header file requires
BAUD to be defined. After including the header file
USE_2X are defined. First two are used to set UART speed. Last one is used to determine if UART has to be configured to run in double speed mode with given baud rate.
UCSZ00 control the data size. Possible sizes are 5-bit (000), 6-bit (001), 7-bit (010), 8-bit (011) and 9-bit (111). Most common used data size is 8-bit.
With above bits we can set most common configuration: no parity, 8 data bits, 1 stop bit.
PhotoPhoto Windell Oskay
Led matrices are fun toys. Who would not love blinkenlights? Electronics is hard. Electronics is much harder than programming. I had hard time trying to understand how do the led matrices work. What is best way to learn something? Build one yourself.
In a matrix format LEDs are arranged in rows and columns. You can also think of them as y and x coordinates. Lets assume we have 4×4 matrix. Rows would be marked from A to D and columns from 1 to 4. Now we can address each LED by row and column. Top left led would be (A,1). Bottom down led would be (D,4).
Led matrices come in two flavors. Common-row anode (left) and common-row cathode (right).
Figure above shows the different configurations. The difference between these two configurations is how you lit a led. With common-row anode current sources (positive voltage) are attached to rows A..D and currents sinks (negative voltage, ground) to columns 1..4. With common-row cathode current sinks are attached to rows A..D and currents sources to columns 1..4.
For example. To light bottom down led (D,4) of common cathode matrix you would feed positive voltage to column 4 and connect row D to ground. For sake of clarity I will using common-row cathode in examples for the rest of this article.