FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

General discussion on mikroC PRO for PIC.
Author
Message
leo73
Posts: 252
Joined: 09 Jan 2014 15:45

Re: FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

#16 Post by leo73 » 24 Mar 2021 18:20

Hello Sparky,
Are you talking about one scheme like this in picture?
For a moment I'm using one tape cable 4 wires, 100nf in all device and in main power 220nf and 470uf. And noise is more less, I hear noise only if there is activity on i2c bus, for example if a change frequency or set the volume !
Next time I'll use a tape cable 6 wire like you recommended !
Another options I like enable is RDS texture, I'm trying tu write one function. I must understand the mechanism to read RDS texture. Unfortunately didn't find document on line about this argument but I found one complete datasheet for AR1000 (more similar to my AR1010 FM module). If there some one have the RDS decoder code will be welcome in this discussion. I'm sure this FM module have this option because in datasheet is possible able RDS options in to registers.Or I will try to clarify the mechanism of setting the registers of the RDS to enable you to help me.
On 24.Mar.21 11.30:
I tried to set up (at 1 state) the RDS_en and rds_int bits in R1 FM register, after I created one function for read (using FMread) the Register: RDS1, RDS2,RDS3.....RDS6) because FM module fill the texture every time in to this registers. The result , unfortunately is 00FF for all 6 16bit registers (only time for all frequency,) it's an error !!! or FM module not fill registers or I'm not reading in time registers and FM module clear it quickly.
I'm reading the registers every 30 seconds (using timer0) i don't know if this asychronous mode to read is correct !! However the FM module (if rds_bit in enable) produces an RDS interrupt on the i2c line every 5ms but I don't know how to control this interrupt.
So I could write a function where:
1) Set at 1 RDS_int. (using FmWrite func)
2) put in to while circle until RDSR bit is 1. Fmread function to read status on RDSR bit in register status.
3) if it is 1 read all texture 16 bit registers(RDS1....RDS6).
4) reset RDS_int at 0 logical state. (using FmWrite func)
8)
Attachments
Screenshot_20210324-191757.jpg
Screenshot_20210324-191757.jpg (208.52 KiB) Viewed 1680 times
This is tape flat cable i used for i2c communication
This is tape flat cable i used for i2c communication
Screenshot_20210324-190226_1.jpg (80.62 KiB) Viewed 1687 times
AR1000F-datascheet.pdf
(2.54 MiB) Downloaded 52 times
Last edited by leo73 on 24 Mar 2021 19:54, edited 3 times in total.

Sparky1039
Posts: 1179
Joined: 24 Nov 2005 20:07
Location: Colorado, USA

Re: FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

#17 Post by Sparky1039 » 24 Mar 2021 19:50

Yes, that looks perfect.

The ground between the signal lines helps balance out the parasitic capacitance of the cable, lowering cross-coupling effects. I would add 10nF and 1uF caps across each I2C slave VDD pins and see if this helps too. Same goes for the PIC VDD except make the 1uF cap 10uF or more. Also I would add 100nF cap at the VDD point where the I2C pull-up resistors are connected for good measure.

Lastly, for the series resistance in the signal lines, start with the 10 ohms and work up in value. In this situation more is not always better, just enough is. The idea is to dampen some of the pulse step ringing of the clock and data lines from all of the parasitic inductance caused by the breadboard wiring.

leo73
Posts: 252
Joined: 09 Jan 2014 15:45

Re: FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

#18 Post by leo73 » 25 Mar 2021 20:50

Ok tomorrow i'll make all hardware modify !!!
For a moment today i tried to manage and read RDS Texture on AR1010 FM Receiver write follow Function:
(refered library code FIRST VERSION Worked on first forum page)

on 26.Mar.21 10:34 I made the code clearer
paulfjujo you are right False or True is clearer than XF XS !! I did not write original code !

Added to the code FM.h

Code: Select all

#define XS                        0                        // Exit success
#define XF                        1                        // Exit fail
#define READRDSR_ADR        0x13. // Rds ready flag (bit in to register status)
.
.

const unsigned short RDSBuffer_adr[8] ={0x15, 0x16, 0x17, 0x18, 0x19, 0x1A};
.
.
Added to the code AR1010.c

Code: Select all

.
.
.
void read_rds(void) {
 char i;
 unsigned int RDSRgstr;
   
   //set only rds_int_en = 1 don't touch other bits
   // 1010 OR 0000 = 1010 no modyfy bits - 1010 OR 1111 = 1111 set 1 all bits
   // If you want set bits you must do <value> OR 1 bits.
   regImg[1] |= 0x0040;  // 0000000001000000
   FMwrite(1);
   
   // RDS Int respond in 5ms we wait it in do...while cicle
   //Delay_ms(5);
   do{
      if ( FMread(READRDSR_ADR, &RDSRgstr) == XF) //Read all STATUR Register
         errfm();
      RDSRgstr &= 0x0040;       // mask all bit but RDSR no 0000000001000000
   }while(RDSRgstr != 0x0040);  // wait until BIT RDSE became 1
   
   // Read RDS Text in 6 Blocks of 2 byte and store it in RDS_Text global vector
   for(i=0; i<5; i++){
      if ( FMread(RDSBuffer_adr[i], &RDSRgstr) == XF) 
   
   //Read all STATUR Register
         errfm();
         RDS_Text[i]=RDSRgstr;
   }
   
   // 1010 AND 1111 = 1010 no modyfy bits - 1010 AND 0000 = 0000 clear all bits
   // If you want to clear bits you must do <value> AND 0 bits.
   regImg[1] &= 0xFF9F;  //clear rds_int_en = 0 and stc_Int_en  1111111110011111
   FMwrite(1);
}
In the main:

Code: Select all

.
.
// print the content of the  RDS_Text[] global vector
UART1_Write_Text(" Texture:  ");
      for(i=0;i<6;i++) {
        read_rds();
        IntToHex(RDS_Text[i], value);
        UART1_Write_Text(value);UART1_Write_Text(" ");
       }
      UART1_Write_Text("\r\n");
.
.
The result of RDS Texture on UART1:

Code: Select all

Start debug:
Version Chip: 10FF ui: 10FF
Volume:       5
 Texture:  00FF 00FF 00FF 00FF 00FF 00FF

there is nothing in the registers of the RDS texture, does anyone have any suggestions about it? :cry:
Last edited by leo73 on 26 Mar 2021 11:12, edited 11 times in total.

paulfjujo
Posts: 1558
Joined: 24 Jun 2007 19:27
Location: 01800 St Maurice de Gourdans France
Contact:

Re: FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

#19 Post by paulfjujo » 26 Mar 2021 08:59

hello,

i follow your post from far ...

Code: Select all

 if ( FMread(READRDSREADY_ADR, &RDSRgstr) == XF) 
what is XF ?
an ascii value? =='F'
an hexadecimal ? ==0x0F

Oups ! sorry,
i didn't read all detail in your code in previous posts
XF could be replaced bay BAD and XS by OK ..more easy to understand in a short part of code
or False and True ..

leo73
Posts: 252
Joined: 09 Jan 2014 15:45

Re: FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

#20 Post by leo73 » 26 Mar 2021 19:55

Hardware Modifications for leave Softly noise at Volume zero
is like scheme below, they didn't have much effect
I am finishing the motherboard, I believe that when I print this card I will eliminate these parasitic noises !! in the motherboard there will be only the 5v power supply, the pic, a double AOP preamp that will stabilize two analog inputs to operate the vu-meter and the spectrum analyzer, 3 rotary encoders, 3 i2c connectors, 1 scpi connector to program the mcu, and other auxiliary connectors and a control for switching off the amplifier.
While the FM receiver, bluetooth receiver, and the other 4 inputs including the preamps will go to another board.
I think that all these hardware changes to reduce noise are good, and I will report them on the wiring diagram, but you can be sure only by printing the first prototype circuit, after that you can do further tests !! What do you think about it?
Attachments
Screenshot_20210326-194129_1.jpg
Screenshot_20210326-194129_1.jpg (73.53 KiB) Viewed 1628 times

leo73
Posts: 252
Joined: 09 Jan 2014 15:45

Re: FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

#21 Post by leo73 » 27 Mar 2021 19:58

on the datascheet it says that the RDS function is active only for the AR1000 model but not for the AR1010 model. Unfortunately, I found only the AR1010 model on the web.
Vive a look to datasheet page below:
Attachments
Screenshot_20210327-195118.jpg
Screenshot_20210327-195118.jpg (227.99 KiB) Viewed 1617 times

Sparky1039
Posts: 1179
Joined: 24 Nov 2005 20:07
Location: Colorado, USA

Re: FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

#22 Post by Sparky1039 » 28 Mar 2021 00:18

The AR1000 has been discontinued for quite awhile. Your posting of the Airoha data release for this product line is over 14 years old. The AR1010 is the only model still offered by them and its a safe bet it will probably be discontinued in the not too distant future (mature or end of life product).

Your project may be better off using a current device like what is offered from Silicon Labs. In fact there are 2 mikroE FM click boards that provide all of what the AR10xx devices offer.
https://www.mikroe.com/fm-click
https://www.mikroe.com/amfm-click

leo73
Posts: 252
Joined: 09 Jan 2014 15:45

Re: FM Receiver AR1010 I2C problem <1ST VER SOLVED> update:17.Mar.2021

#23 Post by leo73 » 29 Mar 2021 10:32

it's a shame ! because the ARXXXX modules had several advantages:
1) they work at 5v and don't I have to use the i2c signal level adapter 3.3v.
2) they are i2c
3) they are small modules
4) they cost little (0.80 euro) unlike the ones you presented me (Silicon Labs) they are expensive(39$)!
For a moment I found RDA5807 little (unfortunately work at 3.3v)Michelin alternative there's TEA5767(5V), what do you think? Have some else alternative ?

Chase the discussion:
viewtopic.php?f=88&t=78153

Post Reply

Return to “mikroC PRO for PIC General”