#avr Logs

Feb 21 2019

#avr Calendar

10:37 AM paulo_ is now known as Guest59170
10:51 AM nabil_ is now known as nabil
11:14 AM expert975: Why is gcc compiling 'var++' to 'subi r24, 255' instead of 'inc r24'? They do the same thing, right? O.o
11:14 AM expert975: Funny
11:26 AM Igloo: They're both 16 bits / 1 cycle, right? Perhaps just not worth special-casing the +1 case
11:28 AM expert975: Yes, both 16 bit/1 CLK
04:42 PM [1]MrMobius is now known as MrMobius
06:29 PM HelloShitty: Hello
06:30 PM HelloShitty: Is this the correct way to unset bits 1 and 2 of this register:
06:30 PM HelloShitty: TCA0_SINGLE_EVCTRL &= ~( (1 << 2) | (1 << 1));
06:59 PM rue_mohr: HelloShitty,
07:00 PM rue_mohr: #define SetBit(BIT, PORT) PORT |= (1<<BIT)
07:00 PM rue_mohr: #define ClearBit(BIT, PORT) PORT &= ~(1<<BIT)
07:00 PM rue_mohr: #define IsHigh(BIT, PORT) (PORT & (1<<BIT)) != 0
07:00 PM rue_mohr: #define IsLow(BIT, PORT) (PORT & (1<<BIT)) == 0
07:00 PM rue_mohr: #define NOP() asm volatile ("nop"::)
07:17 PM HelloShitty: thanks rue_mohr
07:36 PM rue_mohr: modify as required
07:37 PM rue_mohr: there are macros that will do more for you, but they are complex beasts
07:59 PM expert975: What causes the compiler to output a 'NOP'?
09:07 PM rue_mohr: most often asking it to
09:08 PM rue_mohr: you often need a NOP in the middle of a delay loop, or the compiler will optimize the loop out
11:17 PM day_ is now known as day