Problem with a really simple program

abenn

Senior Member
I'm having a problem with a really simple program that is designed to flash an LED on each of four output channels on an 08M2:

main:
high c.0,c.1,c.2,c.4
pause 200

low c.0,c.1,c.2,c.4
pause 2000

goto main


That's all the code there is -- similar to the example in the manual. On the simulator it appears to work as expected. The problem I'm having is in the prototype the second pause is giving me the flash interval I want, but changing the first pause to modify the duration/brightness of the flash is having unexpected results; too low a figure, say around 40, gives me a very weak flash, but increasing it to 200 gives me a definite double-flash, not the longer brighter flash that I want. I've tried using only c.0 in the program, but the same effect.

The prototype circuit is a very simple one, with each of the four 08M2 outputs going direct to a pair of input pins on a ULN2803AD Darlington array, with the four LEDs connected direct to the corresponding paired outputs of the array.

Any suggestions please?
 

lbenson

Senior Member
What Stelios is suggesting is that your program may be resetting. To test whether this is the case, start the program with a PAUSE 2000 (which may be needed before you can see SERTXD output), and then SERTXD("Starting",13,10). If you get repeated "Starting" messages, either you are missing the pull-down resistor on serin, or you have a wiring problem.
 

abenn

Senior Member
Thanks guys, and sorry to have troubled you. I've just found that by pressing down on the Darlington array chip (it's surface mounted) everything works fine. So it's obviously a bad solder connection somewhere, or a physical problem with the chip. The effect is the same on all channels, so it must be the power or ground pin -- out with the soldering iron!
 
Top