Go Down

Topic: atmega8 pinout (Read 2 times) previous topic - next topic

minoswydis

Hey, i was trying to upload my IRremote code (which perfecly works on arduino) to atmega8, to do that i have to generate hex file and with avrdude upload it to atmega8. BUT there is a problem, on atmega8 pins are named like "PB0" and so on. in arduino there are only pins named by numbers and when i am trying to verify IR code on arduino program it says that "PB0" and other atmega8 pins was not declared in the scope. what sould i do?

westfw


Riva

Pin names are just the same but you may need to change the board type in the IDE to 'Arduino NG or older w/ ATmega8' (assuming the chip has a 16Mhz clock) else you will need a different board.txt definition.

minoswydis

thanks, but now i'm getting another problem :


C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp: In member function 'virtual void IRsend::mark(int)':
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:172: error: 'TCCR2A' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:172: error: 'COM2B1' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp: In member function 'virtual void IRsend::space(int)':
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:180: error: 'TCCR2A' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:180: error: 'COM2B1' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:198: error: 'TIMSK2' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:207: error: 'TCCR2A' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:208: error: 'TCCR2B' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:208: error: 'WGM22' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:211: error: 'OCR2A' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:212: error: 'OCR2B' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:224: error: 'TCCR2A' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:229: error: 'TCCR2B' was not declared in this scope
C:\Users\PUKIS\Documents\Arduino\libraries\IRremoteeee\IRremote.cpp:234: error: 'TIMSK2' was not declared in this scope


but if i choose Arduino NG or older w/atmega168  it doesn't show any problem.

Riva

I know the mega8 has less PWM's (amongst other things) than the mega328 and it looks like the IRremote library is using some features that don't exist in the mega8. I don't know if it's possible to change/configure the IRlibrary to suit. Might be as well to grab a new 328 as it's pin compatible with the 8 and swap them over.

Go Up