Hello,
I just wondered if anybody could help me? I am trying to make a binary clock for my brother as a Christmas present but I have run into a few problems. I have started by using the text "The PIC Microcontroller" by John Morton which appears a lot on this forum.
The good news is that it kind of works
, the code I have (which is written in .ASM) does count up the seconds to the right timing, and the so does the minutes and hours, but I have tried to be clever and use portb as the output for seconds, minutes and hours and porta is used to drive a transistor so that the correct LED bank (sec, min & hour) illuminate when called upon. This feature is referred to as strobing in the text and minimises the required number of I/O.
I currently have this project on a breadboard and I am using the pic16f54, and my connections for my pic are as follows
1 - Connected to Base of transistor 3 (drives hour LED bank) via a 68ohm resistor
2 - Not connected (NC)
3 - NC
4 - Connected to +4.5V supply via a 1.5k resistor
5 - +4.5V supply
6 - LED bank 1 ,2 & 3 (Bit 0 - LSB)
7 - LED bank 1 ,2 & 3 (Bit 1)
8 - LED bank 1 ,2 & 3 (Bit 2)
9 - LED bank 1 ,2 & 3 (Bit 3)
10 - LED bank 1 ,2 & 3 (Bit 4)
11 - LED bank 1 ,2 & 3 (Bit 5 - MSB)
12 - NC
13 - NC
14 - NC
15 - NC
16 - Connected to a 2MHz Crystal Oscilator
17 - Connected to Base of transistor 1 (drives seconds LED bank) via a 68ohm resistor
18 - Connected to Base of transistor 2 (drives minutes LED bank) via a 68ohm resistor
The Oscillator is set to XT
WDT = OFF
Code Protect = OFF
I have attached my code (BCLKv7).
Now when I power up this circuit the following happens
1) Seconds LED bank functions correctly
2) The minutes LED bank appears to be an amalgamation of the seconds and minutes timer
3) What should be the hours LED bank functions as the minutes LED bank perfectly without the amalgamation.
Now obviously if I swap pins 18 and 1 on the PIC it half solves the problem, but this isnt the answer. I have played around with the porta assignment in case I have shorted tracks on my breadboard and this doesn't appear to be the problem. Does anyone have any ideas?
Im sorry this is my first post. I know its a bit long, but I though it best to include everything.
P.S. I wanted to add a schematic with this post, what's the best way to do this? Do you simply use a particular program and upload it as an attachment?
P.S.S. I know at this time their is know way of setting the clock, but im just talking one step at a time as im quite new to this
Thanks Guys,
Talcum
I just wondered if anybody could help me? I am trying to make a binary clock for my brother as a Christmas present but I have run into a few problems. I have started by using the text "The PIC Microcontroller" by John Morton which appears a lot on this forum.
The good news is that it kind of works
I currently have this project on a breadboard and I am using the pic16f54, and my connections for my pic are as follows
1 - Connected to Base of transistor 3 (drives hour LED bank) via a 68ohm resistor
2 - Not connected (NC)
3 - NC
4 - Connected to +4.5V supply via a 1.5k resistor
5 - +4.5V supply
6 - LED bank 1 ,2 & 3 (Bit 0 - LSB)
7 - LED bank 1 ,2 & 3 (Bit 1)
8 - LED bank 1 ,2 & 3 (Bit 2)
9 - LED bank 1 ,2 & 3 (Bit 3)
10 - LED bank 1 ,2 & 3 (Bit 4)
11 - LED bank 1 ,2 & 3 (Bit 5 - MSB)
12 - NC
13 - NC
14 - NC
15 - NC
16 - Connected to a 2MHz Crystal Oscilator
17 - Connected to Base of transistor 1 (drives seconds LED bank) via a 68ohm resistor
18 - Connected to Base of transistor 2 (drives minutes LED bank) via a 68ohm resistor
The Oscillator is set to XT
WDT = OFF
Code Protect = OFF
I have attached my code (BCLKv7).
Now when I power up this circuit the following happens
1) Seconds LED bank functions correctly
2) The minutes LED bank appears to be an amalgamation of the seconds and minutes timer
3) What should be the hours LED bank functions as the minutes LED bank perfectly without the amalgamation.
Now obviously if I swap pins 18 and 1 on the PIC it half solves the problem, but this isnt the answer. I have played around with the porta assignment in case I have shorted tracks on my breadboard and this doesn't appear to be the problem. Does anyone have any ideas?
Im sorry this is my first post. I know its a bit long, but I though it best to include everything.
P.S. I wanted to add a schematic with this post, what's the best way to do this? Do you simply use a particular program and upload it as an attachment?
P.S.S. I know at this time their is know way of setting the clock, but im just talking one step at a time as im quite new to this
Thanks Guys,
Talcum
Last edited: