Post Created date
hidden gem
uint8_t parallel_data = PIND, mask = 0x01; while (mask) { (parallel_data & mask) ? (PORTB |= 0x01) : (PORTB &= ~0x01); mask <<= 1; Is that one of the cases...
Saturday, 12 October 2019 - 20:12
hidden gem
I lurv "ldi r25, 0x00".  And then OR with r18?  What?  Can't 'mov' do it all? Yeah.  Some of that is that I didn't cast the RHS math to __UINT24, so it's...
Saturday, 12 October 2019 - 01:44
hidden gem
but not a 24-bit number.    Hmm?   It still works...   void main() { __uint24 x; x = (PORTC << 8) | PORTD; 38: 25 b3 in...
Friday, 11 October 2019 - 06:35
@ATMEL - Please make the assembler(s) available in a zipfile
or anything with the words "asm" in it. It does include the gnu assembler for AVR ("avr-gas") Unfortunately gas is not very compatible with avrasm2 :-(  
Friday, 11 October 2019 - 05:02
RTC Configuration
LEDupdateFlg = 1;Is LEDupdateFlg declared as "volatile"?  
Friday, 11 October 2019 - 01:42
hidden gem
I would also like to see a C compiler pull off my zero-cycle divide by 256.  ;-P Here you go.   It's a shame that the compiler didn't do a better job constructing...
Friday, 11 October 2019 - 01:17
ISR with function arguments (in a modular driver approach)
Interesting.  I was thinking of mentioning that a bit of inline asm and some C++ templates might do a reasonable job.   However: ldi r2, 2Is not a legal instruction...
Wednesday, 9 October 2019 - 04:06
hidden gem
Best to avoid those methinks. Simple code = simple defects. Amen.  Remember that someday, someone who doesn't know, or doesn't remember, these sorts of cute tricks (perhaps...
Wednesday, 9 October 2019 - 03:42
ISR with function arguments (in a modular driver approach)
You can certainly do a thing where you "register" interrupts and arguments for them at runtime, and your ISRs have fixed code that looks a bit like:   ISR(USART0_RX_vect...
Wednesday, 9 October 2019 - 00:19
[Solved] Xplained Pro UART (EDBG) data transparency issues with Macintosh?
bulk endpoints (like CDC) on USB HS devices Ah.  I was wondering whether it had something to do with "High Speed" USB.  Most of the xEDBG things are only Full...
Tuesday, 8 October 2019 - 20:02
ISR with function arguments (in a modular driver approach)
Or you could have a general handler with a parameter, and the hardware-specific ISR fills-in that parameter to identify which UART it came from - something like: void ISR_UART0(...
Tuesday, 8 October 2019 - 07:36
ATMega328PB Datasheet error!
I downloaded from the microchip device page. https://www.microchip.com/wwwproducts/en/ATmega328PB Recently?  The one I just looked at there says copyright 2018 on the bottom...
Tuesday, 8 October 2019 - 07:32

Pages