Inspiration: #Portable Trollmaster 3000
http://hackaday.com/2014/11/12/2-fm-transmitter-for-rasberry-pi/
some experiments with the fm module that features an atmega32
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Inspiration: #Portable Trollmaster 3000
http://hackaday.com/2014/11/12/2-fm-transmitter-for-rasberry-pi/
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.
void set_frequency(unsigned long frequency)
{
unsigned long factor = frequency / 8192;
unsigned int upper = (uint8_t) (factor >> 8);
unsigned int 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 )
void set_frequency(unsigned long frequency)
{
unsigned long 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.
int output_pin = 15;
int randNumber;
ISR (TIMER2_COMP_vect)
{
PORTD ^= ( 1 << PD7 );
}
void setup()
{
randomSeed(analogRead(0));
// set LED pin to ouput
DDRD = ( 1 << PD7 );
//CTC Modus
TCCR2 = (1 << WGM21);
//Prescaler 64
//3686400 / 64 / 440 = 131
TCCR2 |= (1 << CS20);
TCCR2 |= (1 << CS21);
//TCCR2 |= (1 << CS22);
//start with an A
OCR2 = 131 - 1;
//Enable Compare Interrupt
TIMSK |= (1<<OCIE2);
//Enable global Interrupts
sei();
}
void loop()
{
randNumber = random(256);
OCR2 = randNumber;
delay(250);
}
Create an account to leave a comment. Already have an account? Log In.
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
Oh, great, thanks for replies, now my doubts are gone.
I ordered 10 of them (buying one piece instead would be only marginally cheaper than 10 pieces), so I've got new toy to play with.
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...
nice project. These module looks interesting. And for 70cents it is very cheap. Cheaper than a single ATmega32.
Become a member to follow this project and never miss any updates
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?