AVRcoder - C code generator for AVR
AVRcoder is a tool for those, who are just beginning the journey to the world of 8-bit AVR microcontroller. The intension of AVRcoder is to help to remember (or to forget) the meaning of the registers and bits that are controlling the behaviour of the integrated peripherals. Setup register is usually 8-bits wide and every bit is affecting the behaviour of the integrated peripheral device. By AVRcoder you can set over 20 registers, that is, value of over 160-bits that select the behaviour of the device. This does not require one hundred and sixty mouse clicks hence many settings require combination of two or three bits to set their function.
|The value of many registers can be calculated and when calculating some previous information or setting is needed. This is the case when setting up the bus clock frequency of Two-Wire interface. We can calculate what the register value is for some certain bus clock frequency or we can calculate what the bus clock frequency is with some known register value.|
Coding language style is hardware-oriented and easy to understand also for beginners. Instead of using the painstaking long (standard C bit operator) style
DDRD |= (1 << DDD7) |(1 << DDD6) | (1 << DDD4) | (1 << DDD0);
or this style (avrlibc manual)
DDRD = _BV(DDD7)|_BV(DDD6)|_BV(DDD4)|_BV(DDD0);
... we present the value of the register by using a binary number that instantly shows you in what state the bits are. The hexadecimal value is shown in the comment after the code or vice versa, depending of the meaning of the register.
DDRD = 0b11010001; // 0xD1
AVRcoder is implemented with PHP and your web browser must allow cookies. When using AVRcoder you can keep both windows open at the same time, in different tabs of the browser.
After changing settings in Settings window, just click the Reload button in the Code window to update the code. In the settings window, you can see what registers and bits are affected by the setting by moving your mouse cursor over the question mark after the select button.
Try the info popup now, move your mouse cursor to question mark. -> > > > ?