This will be my take on the Sony Ericsson MMR70 radio modules that feature an atmega32 on board. There are not all pins from the atmega32 broken out on the board, but for 70cents you get a decent mictrocontroller and a FM transmitter with SPI and I2C pins broken out.
I thought about using the Talkie library for arduino with this module, inspired by #Gas Sensor For Emergency Workers , but it is written for 16 MHz and I would have to deal with timers (again). 16MHz resonators are ordered - although I'm not certain that the atmega32L will work properly at 16MHz and 2.8V. I will look into that, but will also order 8MHz resonators as well and maybe a new LDO for 3.3v? I'm also waiting for some 2x3 pin headers for easier programming via an ISP connector and might make a labeled board... idk.
So with the help of the code from #Portable Trollmaster 3000 I was able to set up the module in no time. It works on the atmega32 (no real surprise here). I've made some little changes to the program - I set the sending power all the way up with the help of the datasheet and also worked on the following function. This should make it easier to set the frequency.
voidset_frequency(unsignedlong frequency){
unsignedlong factor = frequency / 8192;
unsignedint upper = (uint8_t) (factor >> 8);
unsignedint lower = (uint8_t) ((factor << 8) >>8);
Wire.beginTransmission(NS731_I2C_addr);
Wire.write((uint8_t) 0x0a);
Wire.write((uint8_t) lower); // lower 0XEA is 90.0 Mhz 77 / 33 for 108
Wire.write((uint8_t) upper); // upper 0X2A Change those values to change the frequency
Wire.endTransmission();
}
updated function, removed not needed type castings etc. (thanks to @al1 )
voidset_frequency(unsignedlong frequency){
unsignedlong factor = frequency / 8192;
uint8_t upper = factor >> 8;
uint8_t lower = factor;
Wire.beginTransmission(NS731_I2C_addr);
Wire.write((uint8_t) 0x0a);
Wire.write(lower); // lower 0XEA is 90.0 Mhz 77 / 33 for 108
Wire.write(upper); // upper 0X2A Change those values to change the frequency
Wire.endTransmission();
}
There actually is already a good pinout picture, but I wanted to correct the voltage and be on the safe side when it comes to copyrights - so I fired up inkscape.
1. as far as I have seen yes, there is an Atmega32L in everyone
2. yes they do, trollmaster used a trinket for the trinket contest and the FMBerry ignored the MCU because: why implement a bridge over the atmega when you can go directly
3. the onboard MCU will probably only talk to the radio when it gets the commands from the cellphone over the joined RX/TX, otherwise it gets silent or even sleeps
4. indeed I do :) you can flash it over the ISP test pins
to 3. unfortunatly not. I had quite some issues while working on the FMBerry with that. The easy solution is: just solder a bridge from the AVR reset pin to ground. The AVR will switch all of its pins to high-impedance and your good to go.
If you don't do that, the AVR will talk to the NS741 quite regularly, I've gotten mails from people telling me, that their FMBerry stops to work after 30 seconds...
I couldn't resist and ordered a few MMR-70 modules. Before they arrive I'd like to get things straight:
1, Do all MMR-70 contain the Atmega32 MCU?
2, If (1==true), does the FMBerry or trollmaster projects just ignore the MCU and talk directly to the FM chip via I2C?
3, if (2==true), doesn't the I2C communication collide? I assume the onboard MCU does some action.
4, You are using the ATmega32 on board, do you?