Post Created date
Regarding a glitch pulse from TCB in singleshot mode
Your function argument is a signed value (char) but CCMP is an unsigned value (uint16_t), so the promotion from char to uint16_t will result in bad values when...
Thursday, 15 September 2022 - 08:17
Struct in flash?
 I don't even understand the #if 0 at the start! The linker script description in the example is just information/comments, and needs to somehow be excluded ...
Saturday, 10 September 2022 - 09:47
Struct in flash?
Its just casting explicitly instead of implicitly, to match the argument type of a called function. The explicit cast, if used but not needed, just documents the implicit cast....
Friday, 9 September 2022 - 21:49
Struct in flash?
When using the C compiler one must write: Not so on any of the newer avr0/1/2/Dx (memory mapped flash). Just 'const' is all you need. Compare the linker scripts of the old vs '...
Friday, 9 September 2022 - 19:32
Struct in flash?  
Friday, 9 September 2022 - 04:52
AVR128DA32 Microcontroller Sleep Mode Issue.
You need the mcu to execute a 'sleep' instruction. Somewhere in the mcc generated code for slpctrl there is possibly something already setup to do that, or they expect you to...
Monday, 5 September 2022 - 16:25
Servo initiation code
If you want to use C++, might as well take advantage of it. This also applies to C, but its better to think in terms of how you can create functions to do various things so that...
Saturday, 3 September 2022 - 22:02
Unwanted offset - Assembly variable in custom section
Is such available for a proprietary toolchain (MPLAB XC8 for AVR)? As long as they stick with gcc, they have to release the sources. The source code is available in the...
Friday, 2 September 2022 - 20:58
Unwanted offset - Assembly variable in custom section
If you are using XC8, then maybe there is something else going on. They changed the way their version handles startup code when copying data and clearing bss, where they do...
Friday, 2 September 2022 - 10:12
Unwanted offset - Assembly variable in custom section
First question would be- how are you getting that data into sram?   Creating a custom section in a ram address range doesn't mean it will act like normal data. The .data...
Thursday, 1 September 2022 - 02:16
Disabeling USART on ATtiny 416
The fractional part is already in the formula.   Assuming 16 samples per bit (normal mode)- BAUD_REG_VAL = (64*Fcpu) / (16*baud)  //the 64* is 'shifting' into the...
Saturday, 27 August 2022 - 11:13
Event system in ATmega1608
But it sure sounds like a convoluted "solution" attempt. And the solution may be as simple as (assuming one-shot mode)- turn off tcb, write the compare value to...
Friday, 26 August 2022 - 19:29