Arduino UNO AF/FM Radio Si4844-B20 I2C Issues

Discussion in 'Digital Circuit Design' started by talexander, Feb 20, 2019.

  1. talexander

    Thread Starter Member

    Feb 5, 2019
    33
    1
    All credit for this project goes to Raymond Genovese. His project can be found at https://www.allaboutcircuits.com/projects/build-an-arduino-controlled-am-fm-sw-radio/ where the full project description can help in understanding my problem. I am trying to make an AM/FM radio with an Arduino UNO and Si4844-B20 chip. The data sheet for the chip can be found at https://www.silabs.com/documents/public/data-sheets/Si4844-B20.pdf. I am using a logic level converter (5v to 3.3v) for the SDA, SCL, INT, and RST pins (Sparkfun). I also converted TWBR=198 for 10kHz and TWBR=38 kHz for 50kHz to accommodate for the 16kHz vs 8kHz difference between the Pro Mini and UNO. I went over the updated circuit three times and it is exactly the same as the picture (updated). In addition, every solder joint has continuity. I cannot get the I2C communication to work and keep getting the following feedback with the incorrect band mode and I should be getting radio frequencies:

    *** Si4844 Quick Test **
    ...setting I2C speed to 10kHz
    ...resetting Si4844
    Si4844 reset complete
    ...sending ATDD_POWER_UP with band set
    Si4844 ATDD_POWER_UP completed
    ...setting I2C speed to 50kHz
    ...sending ATDD_GET_STATUS
    ...completed - tuner information is ready
    Band Mode is 3 [0=FM 1=AM 2=SW]
    Band Index is 31 [0-19 FM / 20-24 AM / 25-40 SW]
    Tuner Frequency (mHz)= 151515.15

    Chip information…
    Final two digits of part number: 255
    Firmware revision: ⸮.⸮
    Component revision: ⸮.⸮
    Chip revision: ⸮

    Entering tuning loop…
    151515.15
    151515.15
    151515.15
    151515.15
    151515.15
    151515.15
    151515.15
    151515.15
    151515.15
    151515.15
    151515.15

    The circuit diagram is shown below, as well as my circuit and modified code:
    SDIO: Purple (SDA)
    RST: Green (12)
    SCLK: Orange (SCL)
    IRQ: Blue (2)


    AMFMSW4-revised-s.jpg

    Breadboard.png
     
  2. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    @talexander Hi, I see you saw my response on the site - good. Give me some time to look this over....
     
    talexander likes this.
  3. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    So, the first thing I notice...well actually the second thing...the first thing is that you are much neater on a breadboard...but the second thing is that I used an Si4844-A10 in the project and you are using an Si4844-B20 - right? So, we deed to find out exactly what the differences are - I can see that they are pin-to-pin compatible, but what about the software?

    Edited: Here is the programming manual link https://www.silabs.com/documents/public/application-notes/AN610.pdf I don't know if there is a later one.

    You need to help me, help you...can you pinpoint the differences? I am listening to radio as I type, but I did that project three years ago and sometimes I don't remember what I did three days ago.
     
    talexander likes this.
  4. talexander

    Thread Starter Member

    Feb 5, 2019
    33
    1
    Thank you! Just as a side note the resistor ladder below the power supply is a separate endeavor. Also, I'm using the Si4844-B20 instead of the A-10 because as far as I know the A-10 is no longer sold and the B-20 is an almost identical replacement after reading through the data sheet.
     
  5. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    Do you have an Arduino Promini 3v https://www.sparkfun.com/products/11114 that was used in the original design?
    That would make somethings a lot easier if you could swap that out for the UNO and voltage converter.

    Do you have a scope?
     
    talexander likes this.
  6. talexander

    Thread Starter Member

    Feb 5, 2019
    33
    1
    The only differences that I can find:

    Additional command argument ARG7 is supported by Si4827/44B parts only

    For Si4822/26/40/44A ATDD parts, due to finite resolution of the ATDD device internal ADC for tune wheel position sensing, very wide frequency range bands should be broken into smaller range sub-bands such that a sub-band should not contain more than 230 channels. For example, the 64–109 MHz band range should be broken into two smaller bands, one from 64–88 MHz and another from 88–109 MHz. Similarly for SW, the entire 5.6–22 MHz range must be broken into 8 smaller bands. Furthermore, there are two band groups for SW, one is for standard or narrow band frequency while another is for wide band frequency range. Thus, we have a total of 16 SW bands. The extended SW band frequency ranges from 2.3–5.6 MHz and 22–28.5 MHz are not covered in pre-defined bands.They are supported only via API and the system controller programming the extended band range.

    For Si4827/44B ATDD parts with new firmware that supports the wide FM bands and the wide SW bands, the host controller is allowed to re-configure a wider band range without the 230 channel resolution restriction. For FM, there are five different band frequency ranges and for each there are two different de-emphasis and stereo separation and RSSI thresholds options. Therefore, there is a total 20 FM bands. For AM, there are 5 different band frequency ranges which support 9 kHz and 10 kHz channel spaces respectively. For SW, we have a total of16 bands, 8 of which are standard narrow ranges while another 8 bands are wider ranges. Note: To change function (e.g. FM RX to AM RX or vice versa), the system controller needs to reset the ATDD device first and then issue ATDD_POWER_UP with the detected band number and optional band properties.

    XOWAIT
    Crystal Oscillator Stabilization Wait Time After Reset. 0 = 600 ms (for typical crystal) 1 = 900 ms (for crystal requiring extra stabilization time) Note: Applicable to Si4822/26/40/44A parts only. Later Si4827/44B parts don’t care this bit and will wait till crystal oscillation is stable unconditionally.

    UNI_AM
    Universal AM Band. 0 = Disable universal AM band (default AFC range of 1.1 kHz) 1 = Enable universal AM band (wider AFC range in tuning) Note: Applicable to Si4827 and Si4844B parts and AMRX mode only

    For later Si4827/44B ATDD parts which support wide FM and wide SW bands, system controller is allowed to set BANDBOT and BANDTOP for the maximum band range without restrictions. System controller is no longer required to reserve extra margin when programming the BANDTOP. 

    BANDBOT and BANDBOT need to be multiple of CHSPC; i.e., exact dividable by the channel spacing. 5. ARG7 is supported by Si4827/44B parts only. System controller is optional to send this argument in the ATDD_POWER_UP command if advanced features are needed.

    ADJPT_ATTN
    Shortwave (SW) Adjacent Tune Wheel Positions Audio Attenuation Option. Audio attention of adjacent tune wheel positions of a station: 0 = (–2 dB, –0 dB, –2 dB) i.e., adjacent points volume levels –2 dB (default) 1 = (–0 dB, –0 dB, –0 dB) i.e., adjacent points same volume levels *Note: This bit is not applicable to wide SW bands (i.e., SW band range > 1.5 MHz), which are supported by Si4827/44B parts. For wide SW bands, all adjacent points will have the same volume level.

    Revision 0.2 to Revision 0.3 
    Added Si4827/44B FM/AM/SW Receiver support. 
    Pre-defined band table 50 µs/75 µs FM deemphasis definition correction. 
    Updated note for host power up I2C clock speed > 10 kHz. 
    Add support of new properties 0x0201 and 0x0202 Reference Clock Frequency settings. 
    Added notes for wide FM bands, wide SW bands, universal AM band and China TV audio channel new features.
     
  7. talexander

    Thread Starter Member

    Feb 5, 2019
    33
    1
    I can try buying the Arduino Pro Mini and testing that. I'm using the UNO because I'm hoping to incorporate Bluetooth/mp3 functionality with a multiplexer. I do have a scope but I'm not sure what to look for on the Si pins.
     
  8. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    OK, here is my thinking so far.

    I looked through the datasheets for the A10 and B20 side by side and nothing jumps out at me.
    I looked through the programming guide and your post and nothing jumps out at me there either.

    It looks like you are not establishing I2C communications with the chip... these response that you get are bogus:
    Band Mode is 3 [0=FM 1=AM 2=SW]
    Band Index is 31 [0-19 FM / 20-24 AM / 25-40 SW]
    Tuner Frequency (mHz)= 151515.15

    So, I would love to see what is going on with SDIO.
    If you had a promini, it would remove anything that we are missing with the UNO, which as you know is faster.
    The INT pin is ok.
    Your calculations for lowering I2C speed (both 10 and 50) look right to me.
     
    talexander likes this.
  9. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    You have the level converter hooked up correctly and you have a good powersupply feeding 3.3 to the B20?
     
    mlsirkis and talexander like this.
  10. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    Have you connected pin 13 of the B20 to GND?? It does not look so on the pic.
     
    talexander likes this.
  11. talexander

    Thread Starter Member

    Feb 5, 2019
    33
    1
    The logic level converter is hooked up correctly and the power supply is 3.3V. I will try the pro mini and see if I have a bad chip or if there is an error somewhere else.
     
  12. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    OK, but check the ground on pin 13 - both 13 and 14 need to be connected to gnd
     
    talexander likes this.
  13. talexander

    Thread Starter Member

    Feb 5, 2019
    33
    1
    Both pin 13 and 14 are connected to ground. The connection cannot be seen in the picture because it is under the board.
     
  14. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    Too bad, thought we might get lucky. OK, I will keep looking and let you know if something occurs to me.
     
    talexander likes this.
  15. talexander

    Thread Starter Member

    Feb 5, 2019
    33
    1
    I really appreciate it. do you think the chip could be bad? I tested two chips out of the package and they both had continuity between pins 13 14 21 and 22 (my memory fails me but it was in this area)? I used pretty minimal heat when soldering.
     
  16. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    One last thing..when you turn the pot after running the program, the frequency numbers (which are bogus) do not change - right?
     
    talexander likes this.
  17. talexander

    Thread Starter Member

    Feb 5, 2019
    33
    1
    Right the numbers stay the same even when the potentiometer is turned.
     
  18. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    It could be, but in my experience, the last thing to check is a bad chip (unless you have a good reason) - it does happen, but a bad connection or some difference in software between the promini 3.3 and the UNO or some difference between the A10 and B20 or something else.

    Right now, I am relatively certain that the I2C communication is not happening.
     
    talexander likes this.
  19. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    Try this change in the software, it *might* make a difference...

    Find:
    Code (C):
    1.  
    2. void I2C_10kHz()
    3. {
    4. // set I2C speed to 10Khz on an 8mHz chip
    5.   TWBR=98;
    6.   TWSR|=bit(TWPS0);
    7. }
    8.  
    9. void I2C_50kHz()
    10. {
    11.   // set I2C speed to 50Khz on an 8mHz chip
    12.   TWBR=18;
    13.   TWSR|=bit(TWPS0);
    14. }
    15.  
    Note that your numbers are different because you have already calculated different values - don't worry about that.

    Change it to:
    Code (C):
    1.  
    2. void I2C_10kHz()
    3. {
    4. // set I2C speed to 10Khz on an 8mHz chip
    5.     Wire.setClock(10000);
    6. }
    7.  
    8. void I2C_50kHz()
    9. {
    10.   // set I2C speed to 50Khz on an 8mHz chip
    11.   Wire.setClock(50000);
    12. }
    13.  
     
    talexander likes this.
  20. Raymond Genovese

    Well-Known Member

    Mar 5, 2016
    1,643
    989
    in setup()
    find
    attachInterrupt(0,SiISR,RISING);
    and change it to

    attachInterrupt(INTpin,SiISR,RISING);

    if it doesn't work, change it back
     
    talexander likes this.
Loading...