dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: RE: ANNOUNCE: Rockbox emulates M-Bus car CD changer (Alpine and OEM)
From: VanBaren, Gerald (AGRE) (
Date: 2004-02-13

Some thoughts on the Sony protocol using a UART to provide the bulk of the timing. This technique is not original, it is used as one alternative to interfacing to the Dallas/Maxim ( 1-wire interfaces (App Note 214)

UARTs can typically do 8 bits and 7 data bits easily, and usually support 6 and 5 bits as well. You have to add a <start> bit, which is one bit time of zero, then 5..8 bits of data, followed by one bit time of ones known as the <stop> bit (which is identical to the gap between successive data frames.

Looking at how long in bit times 1200uSec is:
  9 bit times: 7500 baud
  8 bit times: 6667 baud
  7 bit times: 5833 baud
  6 bit times: 5000 baud

If you set your uart to 7500 baud, 1200uSec is 9 bit times (one start bit and 8 data bits). Thus, the 1200uSec "zero" will be seen by the uart as 0x00. The 600uSec "one" will be seen as 0xF8 (literally give or take a bit :-) since there will be one bit of start and then 3 bits (+/- a bit) of zeros followed by 4 bits of ones. An initialization pulse (2400uSec) will look like a <break>.

Transmitting a "zero" would consist of transmitting 0x00 and then waiting 600uSec for the inter-Sony-bit gap. Transmitting a "one" would consist of transmitting 0xF8 and then waiting 600uSec.

This assumes you can set your baud rate reasonably close to the required baud rate. Since there usually is a fair amount of tolerance built into this kind of protocol, it usually works if you are anywhere in the ballpark (7200 baud should work, 9600 might be a problem).


> -----Original Message-----
> From:
> []On Behalf Of jobarjo
> Sent: Friday, February 13, 2004 12:34 PM
> To: Rockbox development
> Subject: Re: ANNOUNCE: Rockbox emulates M-Bus car CD changer
> (Alpine and
> OEM)
> > No, unfortunately the pin is not interrupt-capable. And
> this is where the
> > nice general concept collapses, sorry.
> Too BAD! ;-(
> I've read your source. Lucky that MBus encoding have fixed
> length bits.
> For the sony s-link it uses variable length pulses:
> might still be possible to hack with the uart. But the BIG
> problem is that
> there is an uncertainty on the last bit value for each byte
> received. So it
> does not seems easily feasible.
> I dont like polling also.
> I will think about a solution.... or find an alpine cd pilot...
> Is it possible to program a 600us timer interrupt to sample
> the pin after
> the first falling edge?
> _______________________________________________

The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.

Page was last modified "Jan 10 2012" The Rockbox Crew