Monthly Archives: January 2015

Passage of AVR GCC Function Parameters

For the curious, below is the method and order that parameters are passed to and from functions in the 8-bit AVR GCC world. A description of the method is given here. uint8_t func1(uint8_t a, uint8_t b, uint8_t c, uint8_t d) … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Arduino C Pointers

Below is an arduino program which demonstrates some basic principles about pointers. Keep in mind, memory pointers (i.e. pointers to variables) are pointers to SRAM memory, while function pointers are pointers to flash memory. The AVR uses a modified Harvard … Continue reading

Posted in Uncategorized | Tagged , , , , | 1 Comment

Stack Grows Down

At first thought, it probably seems odd that the stack “grows” downward. The reason it expands downward is a consequence of GCC compiler commonality with other PC architectures. The AVR µC data memory is proportioned in a similar fashion to … Continue reading

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Dump and Disassemble AVR µC Flash Memory

Read Flash Memory To dump the contents of the flash memory of an AVR microcontroller, you simply need to connect an ISP programmer, and execute the appropriate avrdude command. For example, to dump an ATmega328P based arduino, using an USBTiny … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 3 Comments

Arduino Stack Painting

The stack is a data structure which operates in a last-in-first-out (LIFO) method. In a LIFO data structure, the last element added to the structure must be the first one to be removed. It is typical to visualize a stack … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment