First steps in AVR coding, and would appreciate some guidance.
The only experience I have with AVR, is programming an ATTINY45 to drive IR LEDs at 36kHz.
Currently I have a working set-up on a breadboard connected to an Arduino that is running code.
I would like to replace the Arduino with an AVR (wiring in the process: a battery, a cap and three physical pull-up resistors).
1) Which AVR would you recommend, knowing that space and cost is an issue?
I need 6 pins, including 2 regular I/O pins, 2 digital pins usable for interrupts and a TX and RX pin for my HC-05 Bluetooth module.
Preferably I would be able to burn code using the Arduino ISP routine.
2) Converting code
Is it correct to say that all pure C code, used in my Arduino sketch, can remain unchanged, and only the Arduino functions (such as declaring a pin as input or output) need to be translated to AVR code?
How would one normally go about doing that? Google each individual one and check the datasheet, I'm guessing.
3) Two specific questions on converting code
I'm using attachInterrupt() on Arduino. Any advice on how to convert this to AVR code?
I already found Dean Camera's guide to AVR interrupts on http://www.fourwalledcubicle.com/AVRArticles.php.
I'm using an HC-05 Bluetooth module.
First I start serial communication on the AT 38400 baud rate to change the name of the module, then on 9600 baud rate to Serial.print() an integer to an app on my phone.
What would the AVR equivalent of Serial.begin() and Serial.print() be?
On Arduino, I need to use a baud rate of 9600 for HC-05's communication. Do you expect this to be any different on the AVR microchip?