My Appologies
Sorry guys, I was actually only curious about the vulnerability to the PICAXE chips to static electricity. Previous to PICAXE, I've only dealt with Basic Stamps
eek: I know) and I've never "popped" a chip due to static...
Anyway, I can understand where a diagram is worth a thousand words, so I've attached my circuit in .jpg format (I was going to attach my VSM .DSN file, but wasn't sure if people who aren't running VSM would be able to view it).
So to address some of the ideas offered:
- I'm using the AXE091 development board and powering everything from a 9V adapter connected to the boards input jack. The boards onboard 5V regulator then distributes 5V to the components.
- I have verified that the regulator's output is exactly 5.00 volts and the input to the 28X1 is 5.00V (across pins 20 & 8) - although strangely, there mere act of measuring this causes the PIC to stall (time display freezes). RESET DOESN'T get it working again, but setting the time DOES
- All components shown, except for the display LED's, their resistors and transistors, are on the AXE090 board. The display components are on a separate breadboard with jumper wires connecting to the AXE090 pins as required. The LED connected to the RTC pin 7 (D1 and R4) are on the AXE090 breadboard. I have that there so I can have it blinking at 1Hz as a verification that the RTC is working.
- I have confirmed that the connections match what's shown in the schematic (no shorts, loose wires...)
- I hadn't considered the mA loading on the output pins. I am using inline 300 ohm resistors on each LED in the multiplexed display. As a test, I measured the current from OUT0 (Pin 21) and never saw my DVM exceed 3mA. Since they're multiplexed, there's never more than one LED being fed from any of the 4 outputs (OUT0-OUT3). In the columns, the transistors switch the current, so the only current pins 11-13 and 16-18 supply is the base current (very low)
- I did try holding the RESET button on the board while programming (per the error message box) but that didn't work.
With the STAMP, it was recommended to ties all un-used inputs to ground to prevent them floating. I did a search on this forum and it seemed some do / some don't. Per the schematic, I'm not using outputs OUT4-7 (Pins 25-28) or inputs ADC2/3 (Pins 4-5). They're just floating; Would that matter ?
Incase it's required, here's the code:
Code:
# picaxe 28X1
#rem
-Binary clock using Picaxe 28X1 and DS1307 RTC. Based on code seen on project by user "kevrus" in the "audio/visual"
section of the PICAXE user forum. Original code was for a 3 column clock using 17 LED's in a 5,6,6 layout. Code
modified for use with 20 LED matrix in a 2,4,3,4,3,4 column layout.
-See Binary Clock 6 Column LED.DSN for schematic
#endrem
main:
setfreq m8 'sets operating frequency at power-on
i2cslave %11010000, i2cfast_8, i2cbyte 'initiates and sets DS1307 slave address
let dirsc=%11100111 'sets pins 0,1,2,5,6,7 on portc for ouputs
goto readtime
write_time:
if porta pin0=1 then write_time 'loops until button released
writei2c 0, (b0, b1, b2) 'writes the 'set' hrs,mins,secs into ds1307
low portc 0 'turn off all transistors
low portc 1
low portc 2
low portc 5
low portc 6
low portc 7
readtime:
if porta pin0=1 then ten_hrs_set
readi2c 0, (b0, b1, b2) 'read secs,mins,hrs and store in variables
let pins=%00000000 'switches off all LEDs
low portc 7 'switches off 1's sec LEDs
high portc 0 'switches on 10's hr LEDs
let b4=b2/16 'extracts high 4 bits of b2 to b4 (10's hrs)
let pins=b4 'turns on 10's hr LEDs
let pins=%00000000 'switches off all LEDs
low portc 0 'switches off 10's hrs LEDs
high portc 1 'switches on 1's hr LEDs
let b5=b2 and %00001111 'extracts low 4 bits of b2 to b5 (1's hours)
let pins=b5 'turns on 1's hr LEDs
let pins=%00000000 'switches off all LEDs
low portc 1 'switches off 1's hrs LEDs
high portc 2 'switches on 10's min LEDs
let b6=b1/16 'extracts high 4 bits of b1 to b6 (10's min)
let pins=b6 'turns on 10's sec LEDs
let pins=%00000000 'switches off all LEDs
low portc 2 'switches off 10's min LEDs
high portc 5 'switches on 1's min LEDs
let b7=b1 and %00001111 'extracts low 4 bits of b1 to b7 (1's min)
let pins=b7 'turns on 1's min LEDs
let pins=%00000000 'switches off all LEDs
low portc 5 'switches off 1's min LEDs
high portc 6 'switches on 10's sec LEDs
let b8=b0/16 'extracts high 4 bits of b0 to b8 (10's sec)
let pins=b8 'turns on 10's sec LEDs
let pins=%00000000 'switches off all LEDs
low portc 6 'switches off 10's sec LEDs
high portc 7 'switches on 1's secs LEDs
let b9=b0 and %00001111 'extracts low 4 bits of b0 to b9 (1's sec)
let pins=b9 'turns on '1's sec LEDs
goto readtime
'Set 10's Hours:
ten_hrs_set:
if porta pin0=1 then ten_hrs_set 'loop until set button is released
low portc 1 'switches off other 5 columns
low portc 2
low portc 5
low portc 6
low portc 7
high portc 0 'switches on 10's hrs LEDs
b4=0 'resets b4 (10's hrs) to zero for setting
ten_hrs_inc:
if porta pin0=1 then one_hrs_set 'jump to routine for setting 1's hrs
if porta pin1=0 then ten_hrs_inc 'loop until inc button is pressed
ten_hrs_loop:
if porta pin0=1 then one_hrs_set 'jump to routine for setting 1's hrs
if porta pin1=1 then ten_hrs_loop 'loop until inc button is released
b4=b4+1 'increment 1's hrs variable by 1
if b4>2 then let b4=0 'resets b4 to zero if >2
endif
let pins=b4 'display 10's hrs on leds in binary
if porta pin0=1 then ten_hrs_set 'jump to routine for setting the 10's hrs
pause 10
goto ten_hrs_inc
'Set 1's Hours:
one_hrs_set:
if porta pin0=1 then one_hrs_set 'loop until set button is released
low portc 0 'switches off other 5 columns
low portc 2
low portc 5
low portc 6
low portc 7
high portc 1 'switches on 10's hrs LEDs
b5=0 'resets b5 (10's hrs) to zero for setting
one_hrs_inc:
if porta pin0=1 then ten_min_set 'jump to routine for setting 10's min
if porta pin1=0 then one_hrs_inc 'loop until inc button is pressed
one_hrs_loop:
if porta pin0=1 then ten_min_set 'jump to routine for setting 10's min
if porta pin1=1 then one_hrs_loop 'loop until inc button is released
b5=b5+1 'increment 1's hrs variable by 1
if b5>9 then let b5=0 'resets b5 to zero if >9
endif
let pins=b5 'display 1's hrs on leds in binary
let b3=b4*16 'Calculate 10's hrs as high 4 bits pre BCD hrs load
let b2=b3+b5 'Assemble 4 high and 4 low bits of hrs to b2 for RTC load
if porta pin0=1 then ten_min_set 'jump to routine for setting the 10's mins
pause 10
goto one_hrs_inc
'Set 10's Seconds:
ten_sec_set:
if porta pin0=1 then ten_sec_set 'loop until set button is released
low portc 0 'switches off other 5 columns
low portc 1
low portc 2
low portc 5
low portc 7
high portc 6 'switches on 10's sec LEDs
b8=0 'resets b8 (10's sec) to zero for setting
ten_sec_inc:
if porta pin0=1 then one_sec_set 'jump to routine for setting 1's min
if porta pin1=0 then ten_sec_inc 'loop until inc button is pressed
ten_sec_loop:
if porta pin0=1 then one_sec_set 'jump to routine for setting 1's min
if porta pin1=1 then ten_sec_loop 'loop until inc button is released
b8=b8+1 'increment 10's sec variable by 1
if b8>5 then let b8=0 'resets b8 to zero if >5
endif
let pins=b8 'display 10's sec on leds in binary
if porta pin0=1 then one_sec_set 'jump to routine for setting the 1's sec
pause 10
goto ten_sec_inc
'Set 1's Seconds:
one_sec_set:
if porta pin0=1 then one_sec_set 'loop until set button is released
low portc 0 'switches off other 5 columns
low portc 1
low portc 2
low portc 5
low portc 6
high portc 7 'switches on 1's sec LEDs
b9=0 'resets b9 (1's sec) to zero for setting
one_sec_inc:
if porta pin0=1 then write_time 'jump to routine for writing time to RTC
if porta pin1=0 then one_sec_inc 'loop until inc button is pressed
one_sec_loop:
if porta pin0=1 then write_time 'jump to routine for writing time to RTC
if porta pin1=1 then one_sec_loop 'loop until inc button is released
b9=b9+1 'increment 1's sec variable by 1
if b9>9 then let b9=0 'resets b9 to zero if >9
endif
let pins=b9 'display 1's sec on leds in binary
let b3=b8*16 'Calculate 10's sec as high 4 bits pre BCD sec load
let b0=b3+b9 'Assemble 4 high and 4 low bits of sec to b0 for RTC load
pause 10
goto one_sec_inc
I had to remove the "Set minutes" code to meet the 10,000 character limit, but it's the same as the "Set hours" with the variables adjusted accordingly.
Hopefully this now provides a complete picture.
Thanks for the help,
Regards, John.