PWM decoding
ADP
Posts: 15
I an stuck at writing· a portion of my program that decodes data coming out of 8 bit A/D (representing temperature) into string of binary numbers.
Sample programs, examples and any help will highly be appreciated.
I am programming in BS2.
·
Sample programs, examples and any help will highly be appreciated.
I am programming in BS2.
·
Comments
good luck.
Thanks for your response. I am somehow new to BS2 and am not sure what you meant. I am even having a hard time implementing the algorithm for the PWM decoding.
Do you have any samples or examples that I could get an idea from.
I will really appreciate it.
Shawn
What component are you using? We may already have an example somewhere (there's a very good chance we do).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
I actually am working on designing a vital signs monitor where I have 3 signals (converted to digital already) coming into the BS2 (temperature, Blood oxygen saturation level and Heart rate) and I have to send them to the PC (where labview will be responsible to display the data accordingly). Since I can't send the 3 signals at the same time, I need to compile them in some way and send them through 1 channel one after the other.
I hope this description helps. A sample would help me alot,
Your help is highly appreciater,
A.P
· SEROUT pin, baud, [noparse][[/noparse]sensor1, sensor2, sensor3]
We have lots of samples, but unless you can be much more specific, I don't know which one(s) will best help you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 11/10/2004 4:17:04 PM GMT
I have not connected BS2 to my A/D converters yet. I do have 3 square waves each representing 3 different signals coming out of the A/D.
I understand that they have to be decoded into string of binary numbers before I can actually send them out via a serial cable.
I am quite aware on how to declare the input and output pins, declare the registers and send the signal out.
I am having a hard time with the code that would convert the pulses read from the A/D into binary string.
I would really appreciate if you can provide me with samples and examples that would help me out.
Thanks again.
ADP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
And here's an article from Nuts & Volts that uses the ADC0831 with a variable reference voltage: http://www.parallax.com/dl/docs/cols/nv/vol5/col/nv114.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 11/11/2004 4:14:22 AM GMT
I connected adc0831 ( i actually need to use adc08832 but i just want to see how 831 works) to bs2. I have a code for adc0831 that is even available on parallax website or pretty much everywhere. I, however do not get any display as i change the voltage input that goes into the adc0831 (which is hooked up to a potentiometer). Do i need to use the serout command to be able to see changed on my pc???
If that is the problem, i'm sure it will fix all my problems.
I would really appreciate your help,
thanks
ADP
http://www.parallax.com/dl/docs/books/sw/exp/sw27.pdf
The experiment shows the connections and has a simple program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
thanks for that file for adc0831. Well I was wondering if there is a way that bs2 could just accept 1st 8bits from adc0831 and displays the corresponding voltage value on the debug window and then takes 8 more bits from the next adc0831 (assuming we have 2 adcs bringing in signals to bs2) and display its voltage and then go back to the 1st one and take the next 8 bits and so on???? I suppose the adc0831 continuously throughs binary values out but i just need 8 bit chunks to display at a time.
Thank you Jon. I really appreciate you help and ideas.
ADP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office