View previous topic :: View next topic |
Author |
Message |
Salupa
Joined: 17 Feb 2015 Posts: 2
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9240 Location: Greensville,Ontario
|
|
Posted: Tue Feb 17, 2015 5:03 pm |
|
|
From a quick look at the pdf..
#1.The easy way is to code a PIC to 'emulate' the data stream for test purposes. Dead simple using output_high(),delay_ms() and output_low() as needed to 'build' the data stream. I'd have a 'level value' variable to simulate low, med ,full values to be sure your PIC reads and computes the correct values. Use an oscilloscope to confirm the data stream matches the pdf info !!
#2. You need to 'sync' on the 10ms high followed by the 920ms low, once you've got that wait for 110ms(to get rid of the temp rdg), then get rising edge and trailing edge of the 'level' rdg. Maybe have a 1ms ISR ( say the RTCC ?) and count # of times 'level' was high.Then 'do the math' as in the PDF.
The key to this is to have a KNOWN signal source ( #1 ) that you can control, then breakdown the 'signal decoding' with the 2nd PIC.
Be sure to use a real xtal and not the internal RC osc as timing is critical for this application.
edit ! oops has another look at the pdf... and need to modify my idea...
the data stream really consists of t1..t2..t3..t1..t2..t3..t1.... so you need to 'sync' on the T3 high and low portions of the data stream not the beginning 10ms, 920ms signals.
kinda jumped the gun...
Jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Salupa
Joined: 17 Feb 2015 Posts: 2
|
|
Posted: Thu Feb 19, 2015 7:19 am |
|
|
Thanks, you gave me ideas. I'm trying to read the info with CCP capture. I'll let you know. |
|
|
|