Category Archives: atmel

Atmel coding, Getting some space to play with.

I had an atmel mega 16 lying around that didn’t react to the programmer anymore. This was caused because some wrong fuse bits where set (It expected an external clock). I never took the time to find a way to fix it, but being in need of more space. I’ve looked around my to see read more »

Atmel Coding, Optimalisation

Hitting the 2k program space, I looked to improve the code size. Realizing that using a 16bit value for bit-masks is quiet inefficient on a 8bit avr. Because I don’t store a value larger then 8bit in there, I split the 16bit variable into 2x8bit  variables. This saves allot of cycles  moving stuff unneeded  around. read more »

Atmel Coding, unexpected errors

An atmel uses one clock, in my case I use an external crystal (if you run a clock on it, you don’t want an RC oscilator). Something you should keep in mind is, that (unless specified otherwise) the atmel uses this clock for everything. You timers, interfaces, etc. This can lead to some unexpected problems, read more »

Atmel coding, commen errors

I’ve posted in a previous post that I implemented a clock in the atmel, and that there is an offset because of the time it takes between the calling of the signal, and me setting the counter back to 0. This wasn’t true,  I run the counter with a prescaler of 1/256. So the value read more »