I have code for ATMEGA128. It should be a counter program from 0 to 9.
#include "iom128v.h"
#include "macros.h"
void delay(int ms)
{
int c1, c2;
for(c1=0;c1<ms;c1++)
for(c2=0;c2<970;c2++) NOP();
}
void main()
{
char seg[10]={0b01110111, 0b01100000, 0b00111110, 0b01111010, 0b01101001,
0b01011011, 0b01011111, 0b01110000,0b01111111, 0b01111011};
char i;
DDRC=0b10000111;
DDRA=0xFF;
DDRG=0x01;
PORTG=0;
PORTA=0;
PORTC=0;
PORTC=5;
PORTC=7;
PORTA=0xFF;
PORTC=1;
PORTC=2;
PORTC=6;
while(1)
{
for(i=0;i<10;i++)
{
PORTA=~seg[i];
delay(300);
}
}
}
I run this code in proteus and get the following errors cycled
PC=0x00FC. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21E1]=AA. [U1]
PC=0x0132. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21FF]=99. [U1]
PC=0x0132. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21FE]=00. [U1]
PC=0x0168. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21D6]=21. [U1]
PC=0x016A. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21D5]=D7. [U1]
PC=0x016C. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21D4]=02. [U1]
PC=0x016E. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21D3]=00. [U1]
PC=0x0174. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21FD]=BA. [U1]
PC=0x0174. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21FC]=00. [U1]
PC=0x01E0. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21D2]=0A. [U1]
PC=0x01E2. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21D1]=02. [U1]
PC=0x01E4. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21D0]=D7. [U1]
PC=0x01E6. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21CF]=21. [U1]
PC=0x01E8. [AVR MEMORY] External Memory Write while interface is not enabled (SRE=0): [0x21CE]=7B. [U1]
PC=0x01EA. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21D5]. [U1]
PC=0x01EC. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21D6]. [U1]
PC=0x01EE. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21D3]. [U1]
PC=0x01F0. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21D4]. [U1]
PC=0x0202. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21CE]. [U1]
PC=0x0204. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21CF]. [U1]
PC=0x0206. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21D0]. [U1]
PC=0x0208. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21D1]. [U1]
PC=0x020A. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21D2]. [U1]
PC=0x000E. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21FC]. [U1]
PC=0x0174. [AVR MEMORY] External Memory Read while interface is not enabled (SRE=0): [0x21FD]. [U1]
PC=0x0000. [AVR CPU] RET address = 0x0000 [U1]