PDA

View Full Version : Pulsin 16F819 problem



rekcahlaer
- 11th April 2007, 03:36
Hi there, this is my first post so be kind.
I have been programming PICS for some time and always managed to find the solution to my problems. This one however has me beat.
I am using Proton+ compiler 2.1.3 and trying to get pulsin to work on a 16F819. Never had a problem with pulsin before but on this chip it simply refuses to work. Since the original code was complex I wrote what I think is a very basic test program to get the pulsin to do something. Code follows...

DEVICE 16F819
OSCCON =$60 ' 4 MHz
trisa = %11111111
trisb = %00000000
dim X1 as word
dim X2 as word

main:

delayms 1000

'pulsin PortA.4,0,X1
'pulsin PortA.4,1,X2

X1 = pulsin PortA.4,0
X2 = pulsin PortA.4,1
X1 = X1 + X2
high portb.2



delayms X1

low portb.2

goto main

The idea is that if pulsin works I should see a changing square wave out of Portb.2. I am applying a 5 volt square wave signal to Porta.4 that varies from 20hz to 1000hz. I know you will all probably see the error I have made easily but I have definately confused myself with this on. Am running the internal OSC at 4mhz, have WDT off via the fuses on the ICProg software when programming the chip. Have tried setting the config fuses in software but that didn't help either. Thanks in advance.

skimask
- 11th April 2007, 03:42
I am using Proton+ compiler 2.1.3.

What's wrong with this picture?

rekcahlaer
- 11th April 2007, 07:13
Wrong forum??

Ioannis
- 11th April 2007, 09:20
YES! You win!

Ioannis

skimask
- 11th April 2007, 13:52
Good answer!
Survey SAYS!