mit41301
Published © GPL3+

I2S output FM Tuner with RDS

I2S(Inter-IC Sound) output FM tuner using ESP-01 with RDS and IR remote control. 100% pure digital music output at upto 48ksps. Enjoy!

IntermediateProtip4 hours401
I2S output FM Tuner with RDS

Things used in this project

Hardware components

ESP8266 ESP-01
Espressif ESP8266 ESP-01
×1
Monochrome 0.91”128x32 I2C OLED Display with Chip Pad
DFRobot Monochrome 0.91”128x32 I2C OLED Display with Chip Pad
×1
RDA Microelectronics RDA7088N
×1
Resistor 10k ohm
Resistor 10k ohm
×2
32.768 kHz Crystal
32.768 kHz Crystal
×1
Linear Regulator (Low Dropout)
Linear Regulator (Low Dropout)
AMS117 3.3V LDO
×1
Micro-USB to USB Cable (Generic)
Micro-USB to USB Cable (Generic)
×1
SparkFun Logic Level Converter - Bi-Directional
SparkFun Logic Level Converter - Bi-Directional
×1
Infrared Receiver, 38 kHz
Infrared Receiver, 38 kHz
×1
PiFi DAC: I2S Interface HIFI DAC+ Sound Card For Raspberry PI
Itead PiFi DAC: I2S Interface HIFI DAC+ Sound Card For Raspberry PI
×1
Capacitor 220 µF
Capacitor 220 µF
×1
SparkFun TRRS 3.5mm Jack Breakout
SparkFun TRRS 3.5mm Jack Breakout
×1
Male Header 40 Position 1 Row (0.1")
Male Header 40 Position 1 Row (0.1")
×1
Female Header 8 Position 1 Row (0.1")
Female Header 8 Position 1 Row (0.1")
×1
Female Header 20 Position 2 Row (0.1")
Female Header 20 Position 2 Row (0.1")
×1
SparkFun USB Mini-B Breakout
SparkFun USB Mini-B Breakout
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Male/Male Jumper Wires
×1
Headphones, 18 Hz
Headphones, 18 Hz
×1
Temperature Sensor IC, 256B EEPROM
Temperature Sensor IC, 256B EEPROM
AT24C02 or AT24C04
×1

Software apps and online services

Arduino IDE
Arduino IDE
NodeMCU firmware
NodeMCU firmware
Windows 10
Microsoft Windows 10

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering
Soldering stand, With Sponge
Soldering stand, With Sponge

Story

Read more

Schematics

FM tuner with I2C interface

GPIO1, GPIO2 and GPIO3 are not used in this case

Code

I2S tuner REGister 0x04H setting

Arduino
REGister 0x04H details
BIT #6 set to I2S_ENABLED = "1"
/////////////REG:04//////////////////////WR//
  Wire.beginTransmission(0x11);
  Wire.write(0x04);
  Wire.write(0b10001000);
//         -[B#FEDCBA98]-  
//             ||||||||______(08)-AFCD AFC disable 0- afc work; 1- afc disabled
//             |||||||_______(09)-SOFTMUTE_EN If 1, softmute enable
//             ||||||________(10)-RDS_FIFO_CLR 1 = clear RDS FIFO //RDSR _MODE???
//             |||||_________(11)-DE De-emphasis 0 = 75 μs; 1 = 50 μs
//             ||||__________(12)-RDS_FIFO_EN 1 = RDS fifo mode enable.
//             |||___________(13)-RBDS 1 = RBDS mode enable 0 = RDS mode only
//             ||____________(14)-STCIEN 1 = IINT ENA : STCIEN = 1 will generate low pulse on GPIO2
//             |_____________(15)-RDSIEN 0 = Disable 1 = Enable Setting STCIEN = 1 will generate a low pulse on GPIO2
  Wire.write(0b01000000);     //  Wire.write(0b01000000);
//         -[B#76543210]-  
//             ||||||||_______(0)-GPIO1[1:0] 00 = High impedance 01 = Reserved
//             |||||||________(1)-GPIO1[1:0] 10 = Low 11 = High
//             ||||||_________(2)-GPIO2[1:0] 00 = High impedance 01 = Interrupt (INT)
//             |||||__________(3)-GPIO2[1:0] 10 = Low 11 = High
//             ||||___________(4)-GPIO3[1:0] 00 = High impedance 01 = Mono/Stereo indicator (ST)
//             |||____________(5)-GPIO3[1:0] 10 = Low 11 = High
//             ||_____________(6)-I2S_ENABLED 1-ENABLED : 0-DISABLED
//             |______________(7)-GPIO1_INT_EN???
  Wire.endTransmission(); // stop transmitting
/////////////REG:04//////////////////////END//

I2S tuner REGister 0x06H setting

Arduino
REGister 0x06H settings
DATA_SIGNED = "1"
I2S_SW_CNT = "1000"
/////////////REG:06//////////////////////WR//
  Wire.beginTransmission(0x011);
  Wire.write(0x06);
  Wire.write(0b00000010);
//         -[B#FEDCBA98]-    
//             ||||||||
//             ||||||||______(08)- WS_I_EDGE 0- normal ws internally 1, inverte ws internally
//             |||||||_______(09)- DATA_SIGNED 0- unsigned 1- signed (16-bit audio data)
//             ||||||________(10)- SCLK_I_EDGE 0- normal sclk 1- inverte sclk internally
//             |||||_________(11)- SW_LR Ws relation to l/r channel 0- ws=0->r, ws=1->l: 1- ws=0->l, ws=1->r
//             ||||__________(12)- I2S_mode_select 0- master mode: 1- slave mode
//             |||___________(13)- OPEN_MODE[1:0]
//             ||____________(14)- OPEN_MODE[1:0]
//             |_____________(15)- RSVD
  Wire.write(0b10000000);
//         -[B#76543210]-    
//             ||||||||
//             ||||||||______(0)-R_DELY-R Channel data Delay 1T
//             |||||||_______(1)-L_DELY-L channel data Delay 1T
//             ||||||________(2)-SCLK_O_EDGE If 1, invert sclk output when as master.
//             |||||_________(3)-SW_O_EDGE If 1, invert ws output when as master.  
//             ||||__________(4)[4]-I2S_SW_CNT[4:0]
//             |||___________(5)[4]-I2S_SW_CNT[4:0]
//             ||____________(6)[4]-I2S_SW_CNT[4:0]
//             |_____________(7)[4]-I2S_SW_CNT[4:0]
//                           4'b1000: WS_STEP=48.000kbps;
//                           4'b0111: WS_STEP=44.100kbps;
//                           4'b0110: WS_STEP=32.000kbps;
//                           4'b0101: WS_STEP=24.000kbps;
//                           4'b0100: WS_STEP=22.050kbps;
//                           4'b0011: WS_STEP=16.000kbps;
//                           4'b0010: WS_STEP=12.000kbps;
//                           4'b0001: WS_STEP=11.025kbps;
//                           4'b0000: WS_STEP=08.000kbps;
  Wire.endTransmission();  // stop transmitting
/////////////REG:06//////////////////////END// 

I2S tuner with RDS using ESP-01

Arduino IDE code

Credits

mit41301

mit41301

0 projects • 0 followers

Comments

Add projectSign up / Login