Skip to main content

Posts

Showing posts from April, 2012

8051 4 Bit LCD Interfacing Tutorial

Click Here For Character LCD Basics   Lcd Library The mikroC PRO for 8051 provides a library for communication with Lcds (with HD44780 compliant controllers) through the 4-bit interface. An example of Lcd connections is given on the schematic at the bottom of this page. For creating a set of custom Lcd characters use Lcd Custom Character Tool. External dependencies of Lcd Library The following variables must be defined in all projects using Lcd Library : Description : Example : extern sfr sbit LCD_RS: Register Select line. sbit LCD_RS at P2_0_bit; extern sfr sbit LCD_EN: Enable line. sbit LCD_EN at P2_1_bit; extern sfr sbit LCD_D7; Data 7 line. sbit LCD_D7 at P2_5_bit; extern sfr sbit LCD_D6; Data 6 line. sbit LCD_D6 at P2_4_bit; extern sfr sbit LCD_D5; Data 5 line. sbit LCD_D5 at P2_3_bit; extern sfr sbit LCD_D4; Data 4 line. sbit LCD_D4 at P2_2_bi...

USB to Serial Converter using AVR microcontrollers

AVR-CDC converts USB and RS-232C signals using the AVR micro- controller which has no on-chip USB interface. This technology is based on Object Deveopment's V-USB (Software-USB on AVR), and the CDC (Communication Device Class) protocol was extended over it. AVR-CDC enables PC to communicate with the USB device through virtual COM port. The basic idea of using CDC protocol over Low-speed USB is based on Kyosuke Ishikawa's experiment in 2005. To make it stable and practical, Christian Starkjohann in Object Development helped me modifying his V-USB stack. Since three endpoints and the bulk transfer on low-speed device violates the USB standard, I added a tiny patch driver on Windows' USB stack. Although this technology is quite experimental, it may be useful to interface your original system to PC easily. The circuit is very simple, but it requires a certain amount of skills to control. If you need practical or stable solutions, or you are not familiar with electronics n...

8051 Serial Communication Tutorial (UART)

First, a quick history of RS232. What is RS232? It's just a name for a standard that has propagated from generation to generation of computers. The first computers had serial ports that used RS232, and even current computers have serial ports (or at least USB ports that act like RS232 ports). Back in the day, serial information needed to be passed from devices like printers, joysticks, scanners, etc to the computer. The simplest way to do this was to pass a series of 1s and 0s to the computer. Both the computer and the device agreed on a speed of information - 'bits per second'. A computer would pass image data to a printer at 9600 bits per second and the printer would listen for this stream of 1s and 0s expecting a new bit every 1/9600 = 104us (104 micro-seconds, 0.000104 seconds). As long as the computer output bits at the pre-determined speed, the printer could listen. Zoom forward to today. Electronics have changed a bit. Before they were relatively high power, high ...