-
pimping the board
09/12/2015 at 15:51 • 4 commentsI 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.
-
program progress
09/04/2015 at 08:50 • 5 commentsSo 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(); }
-
Video
09/03/2015 at 16:10 • 0 comments -
Pinout of the module
09/03/2015 at 12:57 • 0 commentsThere 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.
-
sketch for timer
08/31/2015 at 12:33 • 0 commentsint 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); }