Hi all,
I am in a big rush so any help will be greatly appreciated.
I am using;
WINAVR GCC with AVR Studio 4 with a STK500 to program a ATmega8515.
If I goto project -> configuration options, under device it says: "atmega8515".
as verified when I compile the build prompt says
"AVR Memory Usage
----------------
Device: atmega8515
"
The included IO header file is:
c:\winavr-20100110\avr\include\avr\iom8515.h
From the data sheet:
$31 ($51) OCR0 Timer/Counter0 Output Compare Register
From the included file
/* Timer/Counter 0 Output Compare Register */ #define OCR0 _SFR_IO8(0x31)
When I simulate with AVR studio 4, when it gets to writing the value for OCRO, it remains 0. I am using another TCNT and the value OCR1A can be set fine, its just OCR0 for some reason it will not accept the assignment when stepping through the code.
As you can see by the attached picture, as I step through the assignments of setting OCR0 to random values:
//Output Compare Register - 1 = Match after each count OCR0 = 17; OCR0 = 18; OCR0 = 29;
OCR0 remains zero.
I dont know what else to try, its such a simple thing!
Thanks very very very much for any help!