Post Created date
Check if two #defines define same register
avr-mike wrote: Try taking the address of the ports: #if ((&PORTB) != (&PORTMyPin))This should remove the * dereference in the macros.   --Mike   The...
Fri. Aug 24, 2018 - 08:53 PM
Problem in reading data from MPU6050 using I2C protocol
Ah, I see there's an issue with signed values. Take the last sample: z1=58 z2=-120 Acc_z=-120 It looks like I2C_Read_Ack() returns data as a signed 8-bit value and not an...
Tue. Jul 17, 2018 - 11:14 PM
Problem in reading data from MPU6050 using I2C protocol
Acc_x = (((int)I2C_Read_Ack()<<8) | (int)I2C_Read_Ack()); The compiler doesn't guarantee that the two I2C_Read_Ack()s will be called in any particular order. Either the...
Tue. Jul 17, 2018 - 09:54 PM
32768Hz Crystal... 100ms ticks possible?
If you just need a tick counter that increments at 10Hz, you can do something like this: volatile uint32_t tick; void isr_32768() { static uint16_t little_tick; little_tick...
Tue. Jul 17, 2018 - 09:39 PM
Remove unused function warning for functions for #include files
theusch wrote:[How did Cliff deduce C++?] My guess is the "_Z3foov" in the listing. That's a C++ mangled name.
Wed. Jul 11, 2018 - 09:41 PM
NaN macros not working correctly?
If the variable is uninitialized, anything goes. That's because using the value of an uninitialized variable is undefined behavior. The compiler can make any kind of...
Wed. Jul 11, 2018 - 08:32 PM
Issues with memcpy on SAML21
Did you mean to use memset rather than memcpy? Otherwise you're copying data from address 0, which is probably not what you want.
Tue. Jun 12, 2018 - 11:28 PM
will using eeprom_update_block be more efficient?
clawson wrote: Well two things:   1) If you are going to perist over versions do it like this: typedef struct { int width; int height; uint8_t rate; uint8_t...
Wed. May 23, 2018 - 05:09 PM
SAMD21G18 - Bug in MUL instruction? Extensive testing indicates hardware.
Maybe I'm missing something, but if you want to multiply two 32-bit signed values to get a 64-bit signed value, shouldn't $FFFFFFFF multiplied by $FFFFFFFF give you $...
Fri. Apr 6, 2018 - 11:34 PM
Confusing behaviour of pointers
I'm going to question the purpose of declaring __hp1 and __hp2 as pointers in the first place. Why not simply make them instances of struct __heaplist like this? struct...
Thu. Jan 11, 2018 - 03:52 PM
Preemptive vs. Cooperative Multitasking
That appears to use the same technique as Protothreads, which was first released in 2005.
Fri. Dec 22, 2017 - 03:32 PM
Linked Lists & ISRs
aarcane wrote: It won't perform an out of bounds read on the actual internal array named Buffer, but it will allow you to read past the end of the circular buffer data type to the...
Wed. Dec 6, 2017 - 11:41 PM

Pages