Programming the Picaxe to display on the Seven Segment Display

taesoon737

New Member
I am new to picaxe so i am finding it very difficult to get use to it. I am using 'let all pins = b0' command so all whatever the value of b0 will be displayed on the seven segment display. But i dont want all the pins to equal to b0 but only 4 of them so i can use other pins to do something else. Can you please give me a solution???
 

hippy

Technical Support
Staff member
You can set individual pins using "let pin0=" and similar which won't change any other pins. You can also access individual bits of 'b0' using 'bit0' and similar.

Putting both together, say you have your display on pin0-pin3 and the bits you need to copy are in bit0-bit3 ...

let pin0 = bit0
let pin1 = bit1
let pin2 = bit2
let pin3 = bit3

If you need to do that in a number of places you an put it all in a subroutine and then call it when needed using GOSUB.
 

taesoon737

New Member
Thank You!!
So would this display 1 to 59 on my seven segment display:

for b0 = 0 to 59
let pin0 = bit0
let pin1 = bit1
let pin2 = bit2
let pin3 = bit3
high portc 1
pause 250
high portc 2
pause 250
high portc 3
pause 250
wait 59
pause 250
next b0
 

HertzHog

Member
7 segment displays.

I too do not understand your question. I have recently been using a single 7 segment display + decimal point.
In my case all the segments are controlled by different pins on the picaxe say 0-7 e.g. 8 pins.
Each digit is made up of a combination of segments. The segments are labelled 0-7 Starting at the top with 0 and going clockwise. The middle segment is 6 and the decimal point is 7.
So, to build up a digit 8 you need them all high. In my case I use
High 0,1,2,3,4,5,6 to switch on and Low ... to switch the segments off
The other numerals are constructed by selecting the segments needed.
To count I have a case structure for each digit and turn on the appropriate segments for each digit.
I have found even with 1 display I can have 3 figure numbers displayed quite easily (each digit in turn and the units displayed with a decimal point too).
In addition I have developed some other simple 'animated' 'icons' or 'symbols' to display other information. Plus I have a battery monitor too (but that is another story). All on just one display chip. It works well for me. Power efficient too.
HertzHog
 

westaust55

Moderator
You would do well to keep your questions on a common topic together.
You started in this earlier thread: http://www.picaxeforum.co.uk/showthread.php?20495-Picaxe-28x-problem&p=195894#post195894
From this past thread we know that you have a 28X1 ( stated as 28X 1 ) which aligns with using commands like HIGH portC 2
also that you have a 4511 chip as well.

Your program listing has no comments and is rather confusing as to exactly what you are trying to achieve.

You have a loop counting from 0 to 59.
Within that you pass the lower 4 bits directly to the PICAXE outputs.
Note that with 4 bits you will only be able to handle the binary states %0000 = $00 = decimal 0 through to %1111 = $0F = decimal 15
Then you progressively for each pass of the loop set three other outputs high – for what purpose?


You need to provide some clear information so others know what you are trying to achieve before we can help you.
As already requested by eclectic, please provide a schematic diagram of your project to help us understand what your connections are and how the 7-segment display is connected.
How many 7-segment display digits do you have? A link to the display module would be helpful.
A plain English step by step description of what you want the program to do would also help us.

Noting from your earlier post you are trying to count/time up to 7 hours so 0:00 to 6:59
So, as I see it, you need to extract each digit and send it to the 4511 single digit BCD to 7-segment decoder chip then assuming you have a 3 digit display after setting up a digit enable the corresponding digit on the display, then set up the outputs for the next digit, etc
 

taesoon737

New Member
Well i dont have a link to my circuit diagram so i'll try to explain it in plain English. As westaust55 has said, i am building a counter and it will count up to 7 hours. So i will be using three seven segment displays to display the hour and the minutes. I am going to use the 4511b IC to convert the binary from my picaxe and to display the time i will be multiplexing the three seven segment displays. So i have to use the picaxe 28x2 to use the portC command, which will allow me to multiplex the three seven segment displays. I will also have two PTM switches, one to start the counting and one to stop the counting. One of the outputs of the picaxe is connected to the buzzer, which will buzz after 7 hours have gone past.
 

russbow

Senior Member
Do a forum search in the User Projects - Audio / Visual

There is a good countdown timer by Radarman. Will give you the basic principles of the hardware.
 

ajcgkm

New Member
hi I used a 08m2 to output a pulse to the clock signal of a 4026 using a for loop perhaps you could use this method. The code is in the 3rd picaxe manual under 7 segment display scroll down till you see the for next loop.
 

westaust55

Moderator
hi I used a 08m2 to output a pulse to the clock signal of a 4026 using a for loop perhaps you could use this method.
The code is in the 3rd picaxe manual under 7 segment display scroll down till you see the for next loop.
Note that taesoon737 already has a 4511 BCD to 7-seg decoder and seems like his circuit is partially/completely built. Just a case of helping to sort out the code - need to know which PICAXE pins drives what ?????
The 4511 is also covered in PICAXE manual 3 page 21 (just before the 4026 example)
 
Top