![]() ![]() The ATmega2560 however a problem - they ran out of registers in the low I/O space (the bit set clear test instructions only work on the first 32 addresses). If(VPORTB.OUT & 0x01) // 1 word 1 clock for the test, and 1 word for an rjmp (2 if it for some reason needs a jump, but the linker rarely does), just like beforeĤ. VPORTB.OUT |= 3 //3 word, 3 clocks, and not atomic. In general, this means that the UNO put several functions on one pin and these have moved to separate pins on the Mega. Red are differences, where the functionality has moved on Mega2560 compared to UNO. Green have the same function and position as the Arduino UNO R3. VPORTB.OUT = 1 // 2 word 2 clock *and not atomic* Inspired by Nick's UNO pinout I did a similar one for the Arduino Mega2560 R3. ![]() VPORTB.OUT |= 1 // 1 word and 1 clock (sbi/cbi got faster!) Those are in the low I/O space, and can be accessed like the old PORTx/DDRx/INx registers:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |