Hello
I wanted to ask for help maybe someone can help explain how to properly talk to the module AR1010
I can not understand the principle, With the "TEA5767HN FM Radio" module everything works fine but the sensitivity is very poor,
would like to switch to AR1010 module.
Here's the code:
maybe someone can help what i'm doing wrong?
AR1010 FM Receiver IC2 problem
Moderator: Benj
-
- Valued Contributor
- Posts: 1208
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
Re: AR1010 FM Receiver IC2 problem
Hi,
You need to shift the i2c address left one bit - 0x20 << 1 - leave bit 0 as 0 for a write and or ((0x20 << 1) | 1) for a read.
I'd create an extra macro - SendByte (or some such name) to simplify the code (So for example you'd have SendByte(0x20, 10) - or similar..
Note that the AR1010 seems to be superceded by newer models?
Martin
You need to shift the i2c address left one bit - 0x20 << 1 - leave bit 0 as 0 for a write and or ((0x20 << 1) | 1) for a read.
I'd create an extra macro - SendByte (or some such name) to simplify the code (So for example you'd have SendByte(0x20, 10) - or similar..
Note that the AR1010 seems to be superceded by newer models?
Martin
Re: AR1010 FM Receiver IC2 problem
Hi
To build a macros so far I'm not capable, so for the time being I'm building blocks.
I found the "ar1010 programming guide" after this datasheet is required to perform the initialization procedure
R0 00H 0xFFFB
R1 01H 0x5B15
R2 02H 0xD0B9
R4 03H 0xA010
Etc.
I send:
IC2 start> IC adersse +0 (write)> register> data> stop
IC2 start> 0x20> 0x00> 0xFFFB> stop>
IC2 start> 0x20> 0x01> 0x5B15> stop>
IC2 start> 0x20> 0x02> 0xD0B9> stop>
IC2 start> 0x20> 0x03> 0xA010> stop>
Etc.
Is the data transfer procedure correct?
Yes, I know that this IC is old, after all the feedback she has the best sound.
To build a macros so far I'm not capable, so for the time being I'm building blocks.
I found the "ar1010 programming guide" after this datasheet is required to perform the initialization procedure
R0 00H 0xFFFB
R1 01H 0x5B15
R2 02H 0xD0B9
R4 03H 0xA010
Etc.
I send:
IC2 start> IC adersse +0 (write)> register> data> stop
IC2 start> 0x20> 0x00> 0xFFFB> stop>
IC2 start> 0x20> 0x01> 0x5B15> stop>
IC2 start> 0x20> 0x02> 0xD0B9> stop>
IC2 start> 0x20> 0x03> 0xA010> stop>
Etc.
Is the data transfer procedure correct?
Yes, I know that this IC is old, after all the feedback she has the best sound.
Re: AR1010 FM Receiver IC2 problem
Hi
Ok, I'll deal with it, I2c can send 8dit or 10bit instead of 16bit so it was important to convert from 16 to 2x8
IC2 start> IC adersse +0 (write)> register> convert (16> 2x8)> data> data> stop
IC2 start> 0x20> 0x00> (H = 0xFFFB >> 8; L = 0xFFFB & 0xFF)> H> L> stop>
IC2 start> 0x20> 0x01> (H = 0x5B15 >> 8; L = 0x5B15 & 0xFF)> H> L> stop>
IC2 start> 0x20> 0x02> (H = 0xD0B9 >> 8; L = 0xD0B9 & 0xFF)> H> L> stop>
IC2 start> 0x20> 0x03> (H = 0xA010 >> 8; L = 0xA010 & 0xFF)> H> L> stop>
Thanks
Ok, I'll deal with it, I2c can send 8dit or 10bit instead of 16bit so it was important to convert from 16 to 2x8
IC2 start> IC adersse +0 (write)> register> convert (16> 2x8)> data> data> stop
IC2 start> 0x20> 0x00> (H = 0xFFFB >> 8; L = 0xFFFB & 0xFF)> H> L> stop>
IC2 start> 0x20> 0x01> (H = 0x5B15 >> 8; L = 0x5B15 & 0xFF)> H> L> stop>
IC2 start> 0x20> 0x02> (H = 0xD0B9 >> 8; L = 0xD0B9 & 0xFF)> H> L> stop>
IC2 start> 0x20> 0x03> (H = 0xA010 >> 8; L = 0xA010 & 0xFF)> H> L> stop>
Thanks
-
- Valued Contributor
- Posts: 1208
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
Re: AR1010 FM Receiver IC2 problem
& see something like https://robot-electronics.co.uk/i2c-tutorial as to how to shift the address (bit 0) is 0 for write and 1 for read....
Re: AR1010 FM Receiver IC2 problem
Hi
It's clear. I'll optimize the code when I check and understand all the features. I've been working with writing, everything works,
the problem is with the reading:
start> id (Wr)> registry adresse> restart> id (r)> read 15: 8> read 7: 0> stop
Start> 0x20 (Wr)> 0x13 (Wr)> Restart> 0x21 (Wr)> H (R)> L (R)> Stop
it looks like after the 0x21 command disappears clock signal, the transmitter pulls data pin low and microcontroller lockup
What am I doing wrong?
It's clear. I'll optimize the code when I check and understand all the features. I've been working with writing, everything works,
the problem is with the reading:
start> id (Wr)> registry adresse> restart> id (r)> read 15: 8> read 7: 0> stop
Start> 0x20 (Wr)> 0x13 (Wr)> Restart> 0x21 (Wr)> H (R)> L (R)> Stop
it looks like after the 0x21 command disappears clock signal, the transmitter pulls data pin low and microcontroller lockup
What am I doing wrong?
-
- Valued Contributor
- Posts: 1208
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
Re: AR1010 FM Receiver IC2 problem
I did some code that uploaded data via i2c for the am2320 temp/humidity sensor
(at viewtopic.php?f=66&t=19786)
Which may or may not be a helpful template?
Martin
(at viewtopic.php?f=66&t=19786)
Which may or may not be a helpful template?
Martin
- Attachments
-
- am2320.fcfx
- (13.96 KiB) Downloaded 380 times