2

I'm planning on using my Raspberry Pi in my car as an XBMC server. I'll be able to select songs/videos using the Android remote control app, but it occurred to me that it would be really neat if I could control XBMC using the CD player controls.

I drive a Toyota Tarago and have the stock CD player which can connect to a CD changer using AVC-LAN (similar to IEBus). The CD player head-unit allows you to select the disc, file and track. I think it would also allow you to "seek" back and forward within the song/movie.

I've seen a few sites that use various PICs together with CAN transceivers and comparators. Does anybody have any experience with using a Pi to communicate on the IEBus directly? The Pi has I2C, SPI and UART - would any of these be suitable?

According to this document I would need timing resolution down to the microsecond (might have a tolerance of 1 or 2 microseconds). I can't bit-bash using the GPIO because test results I've seen show that even with CONFIG.PREEMPT_RT defined in the kernel, when you request a 100us sleep, a C program will actually sleep anywhere between 12 to 282us.

I figure that I should be able to format a char[] and send via UART/SPI/I2C. Basically I need to drive the line (and ultimately read from the line):

  • high for 7us
  • low for 20us
  • high or low for 13us depending on the bit value.

I think that I should be able to make something like this, substituting the AtMega8 with a RPi to drive the PCA82C250

  • Hey, did you succeed on that? – banzsh Jun 21 '14 at 17:05
1

The Raspberry Pi isn't really suited for this application. You'll need to use hardware timers and pin interrupts to do it right. To receive a message on the bus, each part of it must be acknowledged or the transmitting node will give up and not send the rest of it. That means you can't read anything without writing a zero bit at precisely the right time.

Your best bet would to be use a PIC/AVR/other micro to do the bus interactions and communicate with the micro using I2C/UART/SPI

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.