Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

xTimer with 4094

xTimer with 4094

This new design uses a cheap CMOS shift register, 4094 for LED interface. Each 4094 drives a 0.5″ 7-segment without the need of limiting resistor. The left-hand LED is timer function with buzzer alarm output. The right-hand is for clock display.
Software The firmware is timer interrupt driven program. The interrupt rate is 100Hz. The XTAL is 24MHz. Timer0 receives 24MHz/12=2MHz. To produce 100Hz, the reload value then equal 65536-20000=45536 or 0xB1E0. Below is timer0 interrupt service function. All tasks will be executed every 10ms The autho has replaced timer function for timer3 and timer4 with clock. Below shows new layout. Now Key3 and Key4 can adjust current time for HOUR and MIN easily. The SPI signals: DIN, CLK and STROBE are declared to use P1.6, P1.7 and P1.5. The function that interfaces to the eight 4094 is write_LED( ). The function has a nest loop using variable i and j. i is for inner loop counting, j is outer loop counting. The inner loop shifts 8-bit from buffer variable. Begin with buffer[0] to buffer[7]. Each byte will shift bit 7 first. This is done by ORing with 0x80. If true, then set DIN with “1” else with “0”. The bit is shifted with 0-1 transition of CLK signal. The inner loop will do 8 times by outer loop counter using variable j. When 64-bit are shifted, the STROBE signal will make 1-to-0 transition to strobe all bits to the output.

Visit Here for more.

 

More Articles to Read

App note: Working voltage ratings applied to inductors
App note: Working voltage ratings applied to inductors
1968 Princeton Reverb Repairs
1968 Princeton Reverb Repairs
Skill Sunday: Power Over Ethernet for Arduino
Skill Sunday: Power Over Ethernet for Arduino
More on Color TFT Displays ~ The Big Ones — 240 X 320
More on Color TFT Displays ~ The Big Ones — 240 X 320
Vertical Pole Climbing Robot
Vertical Pole Climbing Robot
ESP8266 Weather Station Projects
ESP8266 Weather Station Projects
Single tube Lethal Nixie clock
Single tube Lethal Nixie clock
How to make a simple 1 watt audio amplifier (LM386 based)
How to make a simple 1 watt audio amplifier (LM386 based)
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Dot² isn’t your typical coffee table
Dot² isn’t your typical coffee table

Top




Shares