Friday, February 27, 2009
LED Fan Clock
LED Fan Clock - Uses an LED as a light strobe and the persistence of vision technique to show static coloured hands on a RPM countable computer fan like a clock.
http://spritesmods.com/?art=ledfanclock&page=1
Tuesday, February 24, 2009
Interesting Maxim Chips
MAX6952
The MAX6952 is an SPI based 5x7 dot matrix LED display driver that can drive up to 4 monochrome displays or 2 dual-colour displays.
MAX232
The MAX232 is a very well known chip that converts TTL USART signals (such as the ones on the PIC) to RS232 level signals (on the PC).
DS3234
The DS3234 is a precision real time clock with integrated crystal and 256 bytes of SRAM.
MAX5402
The MAX5402 is a 256 step digital potentiometer.
Maxim IC gives out free samples. Sign up and order.
Build Your Own Clock
Here's a neat project idea to build your own clock using a PIC microcontroller.
Parts:
- A PIC microcontroller (16F886 seems like a good choice; a 12F683 can also be used).
- A 32.768 kHz crystal for timing (can be used as the primary clock source as well as timer clock source for the PIC).
- A display. For this purpose, an LED Matrix display or LED 7 segment display can be used. A very low power static LCD can also be used if low power consumption is part of the design goal.
- Shift registers can be used to drive the LED displays.
- Optionally, a system to synchronize to local low-frequency radio time signals can be added.
- A light level sensor can be used to automatically adjust LED brightness based on ambient light levels. Should be dim during the night and bright during the day. (Possible use for a photoresistor hooked up to the ADC on the PIC?)
- Include a user-programmable alarm.
- Include a calendar.
Monday, February 23, 2009
Oscilloscopes
A short article on oscilloscopes - http://www.best-microcontroller-projects.com/handheld-oscilloscope.html
Make a clock using a 32768 Hz crystal and a low end PIC
32768 Hz crystals are extremely common and are used to make clocks as the number 32768 = 2^15 and can therefore be easily divided to obtain a 1 Hz pulse. Further information is provided on the Wikipedia article on quartz clocks. I believe the crystal can be used with a PIC as a secondary clock source for one of the internal timer modules which can generate an interrupt every so often with an exact frequency and therefore be used as a real time clock.
Another cool blog discovered here: http://picnote.blogspot.com/
And some interesting articles:
1Hz Clock Generator using PIC12F675 Clock with 32.768KHz Crystal
Sunday, February 22, 2009
Multivibrator
Wikipedia:
A multivibrator is an electronic circuit used to implement a variety of simple two-state systems such as oscillators, timers and flip-flops. It is characterized by two amplifying devices (transistors, electron tubes or other devices) cross-coupled by resistors and capacitors. The most common form is the astable or oscillating type, which generates a square wave—the high level of harmonics in its output is what gives the multivibrator its common name.http://en.wikipedia.org/wiki/Multivibrator Can be used to build oscillators, touch switches, flip flops and so on.
Friday, February 20, 2009
Displaying custom 5x8 characters on your HD44780 LCD
Creating and displaying your own custom characters on your HD44780 based LCD is very easy. When you send "data" to the LCD (which represents an ascii character to be displayed), the LCD consults its internal ROM and looks up the pattern corresponding to your character. This internal ROM can not be modified by the user and contains a fixed set of characters that can be displayed. However, the LCD also contains some internal RAM that can be used by the user to define his own set of characters. There is enough character RAM for up to 8 custom characters to be defined.
Step 1: Send the Command
To define your own custom characters, you simply write to the character RAM. To do this, simply send the command (0x40 + address). The address can be anywhere from 0 - 63 as there are 64 bytes available for use. To start out, simply set the address to zero. So, send the instruction (0x40). I have my code set up like this:
send_cmd(0x40 + 0);
Step 2: Send the Data
You are now ready to start sending data to the LCD module to define your own characters. Each of the LCD blocks is composed of 5x8 pixels. Each row of pixels, top to bottom, represents one byte. Since each row only has 5 pixels, only the lower 5 bits of each byte you send will be considered by the LCD module. So, to start defining a character like the one shown here, you will need to now send the following data like this:
send_data(0b00000);
send_data(0b00100);
send_data(0b00010);
send_data(0b11111);
send_data(0b00010);
send_data(0b00100);
send_data(0b00000);
send_data(0b00000);
The character RAM pointer will auto-incriment so you don't have to keep setting the address. Just send the data. The above 8 bytes define the first character. To define another character, just directly send another 8 bytes representing your second character.
Step 3: Use Your Characters
To use your freshly-created custom characters, all you have to do now is set the display address back to a valid position on the LCD screen and send your character. Every character you define has an ascii value of 0 - 7. For example, to display your first character, send the number 0x00 as data. If you have a second, third or fourth (or so on) character defined, send data 0x01, 0x02, 0x03 (and so on). I have my code configured as follows:
set_cursor(2, 1);
send_data(0x00);
This will display our custom character.
Here's a complete program that puts it all into context:
http://pastebin.com/f3fb04ca
The above program utilizes my HD44780 C18 Driver Code.
Step 1: Send the Command
To define your own custom characters, you simply write to the character RAM. To do this, simply send the command (0x40 + address). The address can be anywhere from 0 - 63 as there are 64 bytes available for use. To start out, simply set the address to zero. So, send the instruction (0x40). I have my code set up like this:
send_cmd(0x40 + 0);
Step 2: Send the Data
You are now ready to start sending data to the LCD module to define your own characters. Each of the LCD blocks is composed of 5x8 pixels. Each row of pixels, top to bottom, represents one byte. Since each row only has 5 pixels, only the lower 5 bits of each byte you send will be considered by the LCD module. So, to start defining a character like the one shown here, you will need to now send the following data like this:
send_data(0b00000);
send_data(0b00100);
send_data(0b00010);
send_data(0b11111);
send_data(0b00010);
send_data(0b00100);
send_data(0b00000);
send_data(0b00000);
The character RAM pointer will auto-incriment so you don't have to keep setting the address. Just send the data. The above 8 bytes define the first character. To define another character, just directly send another 8 bytes representing your second character.
Step 3: Use Your Characters
To use your freshly-created custom characters, all you have to do now is set the display address back to a valid position on the LCD screen and send your character. Every character you define has an ascii value of 0 - 7. For example, to display your first character, send the number 0x00 as data. If you have a second, third or fourth (or so on) character defined, send data 0x01, 0x02, 0x03 (and so on). I have my code configured as follows:
set_cursor(2, 1);
send_data(0x00);
This will display our custom character.
Here's a complete program that puts it all into context:
http://pastebin.com/f3fb04ca
The above program utilizes my HD44780 C18 Driver Code.
Subscribe to:
Posts (Atom)