PicAxe Down-Counter

You are in home \ microcontroller \ PicAxe \ Counter (back)  

PicAxe pages: Picaxe General   Wiring up the Picaxe   Programming the Picaxe   Projects  
Projects

Development
Board #1

Dvlpmnt Bd #2

Ideas

   
 

Preliminary info...
This page will be completed soon.
PicAxe Dwn-Cntr Cct This is my first PicAxe circuit which uses the PicAxe-08 to clock a 4026 counter/7-segment decoder, which, through some driver NPN transistors, is displayed on a 7-segment display. First I made it count up the digits, which was easy, then I made it count backwards, again just single digits. Thirdly I made it count down in double digits, displaying the tens and ones digits alternately. To separate the tens digits from the ones digits, it flashes the tens digit for a short time, like 1/4 of a second, then the ones digit, for nearly a second. This makes it reasonably obvious which digit is which, so the number can be read reasonably easily.

The The 4026 counter is used with only two of its inputs driven: the reset and the clock inputs. The reset input resets the counter to zero when it is taken high (positive edge triggered), and the digit is incremented on every positive transition of the clock input. To count upwards, a reset puts it in a known state (zero), and each successive clock pulse increments the display. To count backwards, the display is reset, clocked to one less than the previous digit. Doing this for two digits involved a few loops and subroutines, but was still relatively straightforward.

In the circuit I haven't shown 'unused' inputs, despiking 0.1uF capacitor on the PicAxe, where the jumpers are, or even component values. The 3-way connecter at far-left is the serial connection, used for programming, and also for debug use. The two pin jumper that connects serial in (physical leg 2) and Bit-pin 3 (physical leg 4) is normally connected to allow programming, and is removed to allow serial data in onto bit-pin 3 (physical leg 4) without causing a reprogram to be attempted by the PicAxe. While the jumper is removed to disable programming, the serial-in pin is held low by its own resistor. The 3-pin connector at far right is for use of bit-pin 1 (physical leg 6), which is very versatile as it can be a TTL input, a CMOS output, or a low resolution ADC input. Due to the scarcity of pins, I opted to use bit-pin 3 as serial data in, as it is input only anyway, thus leaving the versatile bit-pin 0 free for other uses. To enable bit-pin 3 as serial data in, an external diode is needed because this port is implemented differently from the other I/O pins and apparently has no internal pullup diode, as I learnt from Rev-Ed's picaxe support forum. Anyway, bit-pin 2 has been brought out with a 3-way connector including +5V and 0V to retain it's versatility. As well as an output such as an LED, buzzer, or whatever, it can be also be an input from a button, switch, or another sensor. Furthermore, using the ADC ability, it can be used to read the (low-res) analog value of a temperature sensor, light detector, or various other resistive sensors, as well as a keypad being possibly, comprising several buttons arranged with a different value resistor each, effectively providing a keypad input on one pin. This design was meant to be versatile and I now intend using it for practicing serial data comms