Author Topic: Micro RDS i2c  (Read 22923 times)

Ken

  • Newbie
  • *
  • Posts: 10
Micro RDS i2c
« on: October 13, 2013, 02:15:04 pm »
Hi,

I'm trying to control my MicroRDS via i2c from an Arduino. But without any success. I run in Mode 3, and if I listen to the radio (only RDS) I hear a tiny "noice" after I sent a I2C message.

I scanned my I2C buss and found that MRDS1322 was on Adress 0x6B, is that correct?

Here is how I did: 

PTY (from doc page 11)

Code: [Select]

  Wire.beginTransmission(0x6B); //Adress of MRDS1322
 
  Wire.write(0xFE);  //Start byte
 
  Wire.write(0xD6); //Control byte ?? // I tried with and without

  Wire.write(0x0A); //Adress PTY
  Wire.write(0x0F); // Data 15 (Other M)

  Wire.write(0xFF);  //End byte
  error = Wire.endTransmission();
 
  if (error == 0)  //0:success
      Serial.println("I2C device OK!");
  else
     Serial.println("Error: No I2C device");



And this for PS

Code: [Select]

  Wire.beginTransmission(0x6B); //Adress of MRDS1322
 
  Wire.write(0xFE);  //Start byte
 
  Wire.write(0xD6); //Control byte ??
 
  //SET PS "MY-RADIO"
  Wire.write(0xC8); //Adress PS
  Wire.write("M"); // Data
  Wire.write(0xC9); //Adress PS
  Wire.write("Y"); // Data
  Wire.write(0xCA); //Adress PS
  Wire.write("-"); // Data
  Wire.write(0xCB); //Adress PS
  Wire.write("R"); // Data
  Wire.write(0xCC); //Adress PS
  Wire.write("A"); // Data
  Wire.write(0xCD); //Adress PS
  Wire.write("D"); // Data
  Wire.write(0xCE); //Adress PS
  Wire.write("I"); // Data
  Wire.write(0xCF); //Adress PS
  Wire.write("O"); // Data
 
  Wire.write(0xFF);  //End byte
  error = Wire.endTransmission();
 
  if (error == 0)  //0:success
      Serial.println("I2C device OK!");
  else
     Serial.println("Error: No I2C device");


All help is welcome.

Thanks!

/Ken


Jan

  • Hero Member
  • *****
  • Posts: 1128
Re: Micro RDS i2c
« Reply #1 on: October 13, 2013, 02:38:05 pm »
That code is not correct.  Please look again at the I2C communication as described in the mrds1322.pdf datasheet.
Mistakes I see:
1) The PTY code does not correspond to the figure 5.7 at all.
2) Control byte (the MRDS1322 address) is not 0x6B but 0xD6 for write operation.
3) There are no start bytes and end bytes when using I2C.
4) Control byte is sent only once as a first byte in each start-stop session.
5) Address byte is sent only once as a second byte in each start-stop session. The address is auto-incremented after receiving each next byte of data.
6) I'm missing I2C stop command in your code.
Please refer to the I2C specification for more details about this bus.
Take note that the I2C bus is not trivial, it is preferred to use a logical analyzer with I2C protocol decoder to ensure that the master generates correct signals.

Ken

  • Newbie
  • *
  • Posts: 10
Re: Micro RDS i2c
« Reply #2 on: October 13, 2013, 03:10:03 pm »
Hi,

OK I got PTY working, but not with 0xD6 as the Adress of MRDS1322. 0x6B works.


Code: [Select]

Wire.beginTransmission(0x6B); //Adress of MRDS1322
 
  Wire.write(0x0A); //Adress PTY
  Wire.write(0x0F); // Data 15 (Other M)

Wire.endTransmission();   






I think Wire.endTransmission is sending the stop command you ask for.



Jan

  • Hero Member
  • *****
  • Posts: 1128
Re: Micro RDS i2c
« Reply #3 on: October 13, 2013, 04:38:22 pm »
0x6B is 0xD6 shifted right by one bit, i.e. not including the read/write bit. Physically the hardware must send 0xD6 as a control byte. Thus the argument of the Wire.beginTransmission function seems to be the 7-bit device address only, without read/write selection. A documentation for this function should tell more.

Ken

  • Newbie
  • *
  • Posts: 10
Re: Micro RDS i2c
« Reply #4 on: October 13, 2013, 05:35:53 pm »
OK but I got everything working now even PS and RT.

Is it possible to sent RT+ with use of User Defined Group, or is RT+ only working with Pira32 and Pira132?

/Ken

Jan

  • Hero Member
  • *****
  • Posts: 1128
Re: Micro RDS i2c
« Reply #5 on: October 13, 2013, 06:46:44 pm »
RT+ is possible but the application must send appropriate groups in real time, that means at the same rate you need them on the RDS output. This can be done via UDG2:
1) Fill UDG2 group (3A or 11A)
2) Set UDG2CNT to 1. The group will occur on the output.
3) Wait for some time, depending on the group rate required. Typically 1 second.
4) Repeat from step 1.

Ken

  • Newbie
  • *
  • Posts: 10
Re: Micro RDS i2c
« Reply #6 on: October 13, 2013, 08:35:00 pm »
Hi,

I think I need some more help on filling UDG2 group...

I know I must send content type, start marker and a length marker. And use adress 67-6C but how to set the data..?

/Ken

Jan

  • Hero Member
  • *****
  • Posts: 1128
Re: Micro RDS i2c
« Reply #7 on: October 14, 2013, 09:27:41 am »
Look at the PIRA32 manual, section 15.3.6. An example of RT+ coding is given here.

Since the MicroRDS does not accept ASCII command UDG1=, the resulting command UDG1=301600004BD7,B00824A02005 valid for PIRA32 must be sent to the MicroRDS as an infinite loop like

1) Start - Control byte - 0x67 - 0x30 - 0x16 - 0x00 - 0x00 - 0x4B - 0xD7 - 0x01 - Stop
2) wait for 1 sec.
3) Start - Control byte - 0x67 - 0xB0 - 0x08 - 0x24 - 0xA0 - 0x20 - 0x05 - 0x01 - Stop
4) wait for 1 sec.
5) go to step 1

There are some recommendations related to the RT+ transmission published by 3rd party, I think you already know them, let me know otherwise, I'll provide that information via email.

Ken

  • Newbie
  • *
  • Posts: 10
Re: Micro RDS i2c
« Reply #8 on: October 14, 2013, 09:41:45 am »
Thanks Jan, just what I needed!

It's a while since I looked into RT+ so there may be some new recomendations, please email me the info.

/Ken

Ken

  • Newbie
  • *
  • Posts: 10
Re: Micro RDS i2c
« Reply #9 on: October 16, 2013, 05:17:35 pm »
Hi,

I don't find any CT in the manual.  Does MicroRDS don't have CT or can I set that via i2c ?

/Ken

Jan

  • Hero Member
  • *****
  • Posts: 1128
Re: Micro RDS i2c
« Reply #10 on: October 16, 2013, 07:53:41 pm »
CT is not supported directly by the MicroRDS. You can send CT using the same way like the RT+. That is, by sending one 4A group each minute.

Ken

  • Newbie
  • *
  • Posts: 10
Re: Micro RDS i2c
« Reply #11 on: October 21, 2013, 09:29:40 am »
Hi,

Can I send ECC with UDG1 or UDG2, if so do you have any suggestions how to send..?

/Ken

Jan

  • Hero Member
  • *****
  • Posts: 1128
Re: Micro RDS i2c
« Reply #12 on: October 21, 2013, 09:41:04 am »
ECC is a fixed content so you may put that group (1A) to UDG1 so the encoder will transmit that group automatically with no more support from your application.

drlucas

  • Newbie
  • *
  • Posts: 3
Re: Micro RDS i2c
« Reply #13 on: March 10, 2014, 04:24:43 am »
sorry to add to this post (maybe better I started a new one? - my first post on this forum - so if need be let me know).

My question is similar but I'm looking for the address for the MRDS192 and not the 1322. I scanned my i2c bus and found a device at 0x49 (see below). Is this the MiniRDS? I'm trying to send commands from the raspberry pi on my EDM transmitter which uses the mini RDS chips.

Let me know if that 0x49 sounds right, or if I'm going down the wrong path. Thanks.
Ryan

pi@FPP /var/log $ sudo i2cdetect -a 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x00-0x7f.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- 49 -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Jan

  • Hero Member
  • *****
  • Posts: 1128
Re: Micro RDS i2c
« Reply #14 on: March 10, 2014, 08:15:22 am »
The MRDS192 address is 0xD6 for write and 0xD7 for read. This old chip however has some clock timing limitations (see the pdf) so you'll probably not be able to control it using hardware based I2C peripheral. If you can access some kind of parallel port on your device, it would be possible to create the control waveforms programmatically.