![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #16 |
|
Thanks guys. Good info'. Is it important to measure the actual active-low portion of the signal or could you simply measure the time between active-low leading edges? Last edited by Mike, K8LH; 30th May 2009 at 06:43 PM. | |
| |
| | #17 |
| It's important to measure the actual active-low time of each pulse, bear in mind it's not just a question of reading SIRC's, it's a question of rejecting all other types of IR signal.
| |
| |
| | #18 |
|
Knowing this info its real easy to create your own IR Protocol. I think ill make one today. Ill call it AIRP or AIRC. AtomSoft InfraRed Protocol AtomSoft InfraRed Control lol. Would be fun to do but would require a custom remote
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
| | #19 |
|
Jason, I agree but one of the interesting aspects of this research is that I could use one of these very inexpensive "universal remotes" as the control head for some of my projects. There would be more unique key codes than I could ever possibly use. Nigel, Thank you for supplementing Pommie's and AtomSoft's excellent examples. I'd like to develop a simpler GetBit routine that qualifies each SIRC bit. Then I could decode the 12 bit style SIRC codes with a very simple routine like this; Code: ;
; the GetBit "blocking" sub' only returns on a valid SIRC bit
;
; C = 1 for a valid <start> bit
; C = 0 and Z = 1 for a '0' bit
; C = 0 and Z = 0 for a '1' bit
;
GetSIRC
call GetBit ; a qualified <start> bit? |B0
bnc GetSIRC ; no, branch, else |B0
clrf irCmd ; clear 'irCmd' variable |B0
bsf irCmd,6 ; set counter bit for 7 bits |B0
CmdLoop call GetBit ; get <data> bit in Z (C=0) |B0
skpz ; bit = 0? yes, skip, else |B0
bsf irCmd,7 ; bit = 1 |B0
rrf irCmd,F ; collected all 7 'Cmd' bits? |B0
bnc CmdLoop ; no, branch, else |B0
clrf irDev ; clear 'irDev' variable |B0
bsf irDev,4 ; set counter bit for 5 bits |B0
DevLoop call GetBit ; get <data> bit in Z (C=0) |B0
skpz ; bit = 0? yes, skip, else |B0
bsf irDev,5 ; bit = 1 |B0
rrf irDev,F ; collected all 5 'Dev' bits? |B0
bnc DevLoop ; no, branch, else |B0
return ; |B0
Thanks again for all the info' guys. Mike Last edited by Mike, K8LH; 30th May 2009 at 03:14 PM. | |
| |
| | #20 |
|
A good while back someone emailed me an interrupt driven version of my original receiver code, I meant to add it to my tutorials, but forgot all about it - and can't seem to find it any more. I'll keep looking. | |
| |
| | #21 |
|
GetBit command would be simple. I would do the same as i did in C which was just wait for a Low or TRIGGER on low then count up until its high then calculate how long it took by reading the count variable. You should know how to do this already lol
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
| | #22 |
|
My code is exactly the same as yours Jason. I'm just having fun trying to make it a bit tighter, cleaner, simpler, and more elegant using assembler (my specialty, grin)...
| |
| |
| | #23 |
|
heh cool! I would love to see it when your done.
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
| | #24 |
|
FYI, found a C project with interrupt driven SIRC decoder as a background task which seems reasonably well done (using Interrupt on Change); PIC RGB Power board with Infrared remote control Last edited by Mike, K8LH; 30th May 2009 at 07:54 PM. | |
| |
| | #25 |
|
To do SIRC in as background wouldnt be hard with my code. All you have to do is setup a interrupt and have it do the same code as in my "GetSIRC" function. Once you copy my code to the interrupt then you should be able to collect data like that. Just remove the first wait for low. Since it will interrupt on low anyway.
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
| | #26 |
|
ill try to create it in a minute. With a RBG LED with PWM just like that link just my own code
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
| | #27 |
|
Oh don't worry, I know how to unroll functions to make them work as part of an ISR (LOL).
| |
| |
| | #28 |
|
heh, i know your one smart dude. You correct me on a daily basis and im grateful. LOL
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
|
| Tags |
| decode, hitech, pica, sony |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Which IR protocal is easier to decode, Sony SIRC or Philips RC5 | blueroomelectronics | Micro Controllers | 5 | 14th January 2008 01:17 AM |
| How to decode.... | arustu | Electronic Projects Design/Ideas/Reviews | 5 | 1st August 2006 10:44 AM |
| bs2pe read decode | egg0900 | Micro Controllers | 3 | 20th June 2005 11:06 PM |
| IR (Encode and Decode signals) | Bella | Micro Controllers | 0 | 27th October 2003 06:46 AM |