Hello,
I am attempting interface of a weigand reader to my pic. My question is, how can i store an incoming pulse stream of highs and lows on a pin and properly set my variable. For instance as a certain pin goes low i want my variable to streams bit value. Example data variable is 00000000 then as pulses come in for 1 and 0 i want to be able to store the proper pulse to the variables bit location. For instance if i receive four pulses for ones and four pulses for zeros my variable must store 11110000. I hope i make any sense.
Thanks!
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
Posted: Tue Jun 06, 2006 5:55 am
This smells like timers.
At what speed is the pulse train coming?
You can read a pin every X time in an interrupt.
then you have to read the pin and set a bit of an 8 bit variable.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum