CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Apple TV IR remote decoding

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Liam_85



Joined: 09 Nov 2014
Posts: 26
Location: Ireland

View user's profile Send private message

Apple TV IR remote decoding
PostPosted: Fri Jan 09, 2015 3:15 pm     Reply with quote

Hello everyone, I hope somebody can help me out. I am trying to decode an Apple TV remote using the 38kHz NEC protocol. I have a flow chart that I was trying to work through with no success. If anybody has any decoder code or could point me in the right direction it would be greatly appreciated. The PIC I am using is a 12f1840. I have tried google and the ccs c forum to no avail. Thanks in advance
_________________
Liam Hanmore
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Fri Jan 09, 2015 5:18 pm     Reply with quote

First thing that comes to mind since you don't indicate exactly what "no luck" means - are you sure they use 38khz? There are several different frequencies used for IR remotes. Is your receiver giving you some sort of pulse train when you aim the Apple Remote at it and press a key or is it ignoring the remote? A scope would be helpful at this point to see what your receiver is doing.

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
temtronic



Joined: 01 Jul 2010
Posts: 9101
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 09, 2015 6:18 pm     Reply with quote

I used Google and located several programs that are in Ardunio C. It's fairly easy to convert into CCS C. Seems to be a 'popular' handheld for controlling 'devices'.

hth
jay
Liam_85



Joined: 09 Nov 2014
Posts: 26
Location: Ireland

View user's profile Send private message

PostPosted: Sat Jan 10, 2015 8:38 am     Reply with quote

The remote is definitely 38kHz. I searched only for the specs of the remote and according to a number of sources including ladyada this particular remote uses the NEC protocol at 38kHz. I have a TSOP1838 connected to the PIC and on the scope I can see pulses when I press a button (it flickers on the scope for a short period of time) and then the repeat pulse if I hold the button. In reply to temtronic I have came across a few arduino programs decoding NEC but not one using PIC CCS C or even MPLAB. Thanks for taking the time to help
_________________
Liam Hanmore
temtronic



Joined: 01 Jul 2010
Posts: 9101
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jan 10, 2015 9:09 am     Reply with quote

another googling located several 'decoders' using HTC, C18 and a few others. It isn't that hard to translate C from one compiler to another. Yo may have to spend an hour or two on the web to find a version you understand but since someone else has got a PIC to do it, it is possible !
You may need to enter other 'keywords' into Google to get a better list of hits.

Jay
Liam_85



Joined: 09 Nov 2014
Posts: 26
Location: Ireland

View user's profile Send private message

PostPosted: Sat Jan 10, 2015 9:33 am     Reply with quote

Thanks temtronic, I will give it a go and if I resolve it I will post it on CCS C for others. I can't understand why there is loads of CCS C code regarding RC5 and SIRC IR encoding and decoding but none with NEC. I know it isn't as popular as the others and slightly a little harder to decode but the only two small sized IR remotes I have happened to use the NEC protocol!!
_________________
Liam Hanmore
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Sun Jan 11, 2015 2:57 am     Reply with quote

As a comment, quite a few things do use 'variants' of the NEC protocol, so there is a lot of code floating around. However save yourself a lot of work, and get a receiver chip, that includes the 38kHz detection and AGC. Look at the Vishay 34838. This gives a 'low' out, when a burst of 38kHz signal is seen. You still need to decode the actual protocol, but you'll save yourself quite a lot of work.... Smile
temtronic



Joined: 01 Jul 2010
Posts: 9101
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jan 11, 2015 7:31 am     Reply with quote

Liam, you hit the nail on the head.... no code cause it isn't popular! That holds true for a LOT of devices. One reason why the Ardunio is popular compared to PICs is tons of neat, easy to use boards with all sorts of 'things' yet no one has come out with a cheap PIC to 'plug and play' with Ardunio style devices. IF 'they' did, it could be a game changer.
If I wasn't so old and stuck in my ways, I'd have gone the A route a decade ago as it's cheap and easy to build small runs of product using off the shelf modules. Not so with PICs as you need to design PCB, mfr, etc.
Creating drivers for devices can be very time consuming and unless there's a market for it, well, you're left doing it yourself.
At least with the 'net', you can find 'something' close, someone else has done, convert to CCS C fairly easy, and carry on...course by the time you get it working, someone else has a 'module' for $2 for sale....


Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Sun Jan 11, 2015 10:54 am     Reply with quote

I think a thing being missed, is that code has been posted on this forum, that will (with only tiny changes) decode this protocol.

If you use a device like the Vishay receiver, then all you have is a string of 1's and 0's, which carry pulse timings used for the 1's and 0's in the final stream. What you will receive is a '0' 562uSec long, followed by a '1' 562uSec long (for a logical 0), or a '1' 1.6875mSec long, (for a logical 1). There have been several code examples published here for decoding such timing streams, using a CCP module. The reason is that exactly the same 'variable width' format is used by just about every IR stream. It's just the durations that change. The Sony protocol (for example), uses 600, and 1200uSec. The code library has a receiver for this format. The NEC format uses a 8bit 'word', while SIRC, uses 12bit.
NEC transmits each byte first as itself, and then as it's bitwise inverse, sending an 'address', and then a 'command' byte.
I'd say that using the receive 'core' of this code, with the timings shifted, and the bit counts changed, it should be possible to receive the format in only a few minutes work.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group