PDA

View Full Version : weird pulsout problem



peterdeco1
- 17th January 2012, 11:13
Hi Everyone. I've used the pulsout command many times with no problems except yesterday. I used it on a 16F819 and the pulse width was 1/2 of what it should have been. I fixed the problem by putting a pause 10 before the pulsout command and another one after it. Any ideas? I never had to do this with a 16F73.

Acetronics2
- 17th January 2012, 18:22
may we have a code snippet + your configs ???

Alain

cc1984
- 18th January 2012, 14:46
Are both running at the same oscillator frequency?

peterdeco1
- 30th January 2012, 15:31
Sorry for the late reply. I shortened the program to only 1 activation so it wouldn't take up a lot of space. The top program is the main circuit that only has one available port to pulsout which is RB0. The bottom program is the "slave" circuit which activates things like a motor or series of LED's. I've used this system before with a 16F73 without any problem but when I use the 16F819, I have to put a pause 10 before and after the pulsout otherwise the pulse is about 1/2 the width it should be. And yes both chips are running at 4MHZ. I solved the problem with the pause commands but am interested in why it is necessary for just the '819.
'main program
START:
NAP 0
IF PORTA.1 = 0 Then ONE
GoTo START
ONE:
LET ADDRESS = 0
Pause 10
PulsOut PORTB.0,100
Pause 10
GoTo PLAY
'slave program
START:
PulsIn PORTA.0,1,WIDTH 'LOOKING FOR A HIGH PULSE
IF WIDTH > 90 AND WIDTH < 110 Then activate1 'LOOKING FOR 1MS = 1000uS
GOTO START
 

Acetronics2
- 30th January 2012, 19:39
Hi,

Try :




LOW PORTB.0
PulsOut PORTB.0,100



BTW : what kind of load is connected to that Port pin ???

Alain