Bcd and the pic 8

springer

New Member
Bcd and the pic 8

Maybe I’ve misunderstood the pin-out on the pic 8, but I find the naming very confusing.
I simply wanted to connect a bcd dot segment 0-F led to a pic 8 and have it count from 0 to F as a test
According to the pin-out diagrams, pin 3 is only an input, however it is still bit 4 internally (for counting purposes)
In order to get the higher order bits (digits 8-F) it is necessary to have a loop count from 0 to 23, as in the code below;
main: b1=0
let dirs = %11111111
for b1 = 0 to 23
let pins = b1
pause 500
next b1
goto main

With the above code, I don’t get a delay as pin 3 (bit 4) is dropped, when counting between 8 and 15, so I assume that something is happening internally to bit 4. Is it getting dropped and ignored?

I suppose my question is; what is happening to bit 4 (pin 3) and it there a better way of doing this, other than use a pic18?
 

Mycroft2152

Senior Member
You said that you wanted to display the numbers from 0 to 23. This is a 2 digit display.

The PICAXE 08 only has a maximum of 4 output lines, so you can only drive 1 BCD to 7 segment decoder at a time. To use the 08 you would need to add, at the minimum, shift register / latch between the 08 and the decoder chip.

At that point, you will be shifting out the binary values, so you won't have a "pin3" problem.

TANSTAAFL!

Myc
 

Michael 2727

Senior Member
Unless you have -cough-ahhem- one of these,
<A href='http://porepunkahps.vic.edu.au/home/jef01/display.htm' Target=_Blank>External Web Link</a>
~;o)

I can supply details.
 

Mycroft2152

Senior Member
If you think about the bit pattern that you want to send out:

# Binary No Pin 3 pattern

0 00000000 00000000
1 00000001 00000001
2 00000010 00000010
3 00000011 00000011
4 00000100 00001000
5 00000101 00001001
6 00000111 00001011
etc

You can see that for any number that is greater than 3, you need to add 4 to it before sending it out.

TANSTAAFL!

Myc

 

tarzan

Senior Member
<A href='http://www.rev-ed.co.uk/picaxe/forum/Topic.asp?topic_id=3691&amp;forum_id=20&amp;Topic_Title=08M%2B%2526amp%253B%2B7seg%2BDISPLY%2BWITH%2B4511&amp;forum_title=No+new+posts+please%21+14' Target=_Blank>External Web Link</a>
 

hippy

Ex-Staff (retired)
Myc : <i>You can see that for any number that is greater than 3, you need to add 4 to it before sending it out </i>

One way to do this would be ...

- FOR b1 = 0 TO 15
- b0 = b1
- bit4 = bit3
- pins = b0
- NEXT

There's some confusion over which bit is which, Pin 3 is Bit 3, both pins and bits start from zero.

Bit 3 is the fourth bit in a byte from the right, and that can cause some confusion.

Edited by - hippy on 2/20/2006 1:54:17 PM
 

Mycroft2152

Senior Member
Of course Bit 3 is the fourth bit in a byte from the right.You should add 8. Thats what happens when you reply at 4 AM. :)

I do like your solution. It's much simpler.

Myc
 
Top