AR1010 FM Receiver IC2 problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Martinsdz
Posts: 5
Joined: Mon Dec 03, 2018 6:01 pm
Contact:

AR1010 FM Receiver IC2 problem

Post by Martinsdz »

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:
AR1010.fcf_avr
(32.43 KiB) Downloaded 277 times
maybe someone can help what i'm doing wrong?

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: AR1010 FM Receiver IC2 problem

Post by mnf »

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

Martinsdz
Posts: 5
Joined: Mon Dec 03, 2018 6:01 pm
Contact:

Re: AR1010 FM Receiver IC2 problem

Post by Martinsdz »

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.

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: AR1010 FM Receiver IC2 problem

Post by mnf »

The address 0x20 should be shifted left one bit (0x40)

Martin

Martinsdz
Posts: 5
Joined: Mon Dec 03, 2018 6:01 pm
Contact:

Re: AR1010 FM Receiver IC2 problem

Post by Martinsdz »

why does the address should be shifted left?

Martinsdz
Posts: 5
Joined: Mon Dec 03, 2018 6:01 pm
Contact:

Re: AR1010 FM Receiver IC2 problem

Post by Martinsdz »

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

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: AR1010 FM Receiver IC2 problem

Post by mnf »

& 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....

Martinsdz
Posts: 5
Joined: Mon Dec 03, 2018 6:01 pm
Contact:

Re: AR1010 FM Receiver IC2 problem

Post by Martinsdz »

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?

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: AR1010 FM Receiver IC2 problem

Post by mnf »

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
Attachments
am2320.fcfx
(13.96 KiB) Downloaded 277 times

Post Reply