#include "Register_mr32.h"
void DELAY(void);
#pragma DATA_SEG SHORT _DATA_ZEROPAGE
unsigned int iCounter;
char *PTR1;
#pragma INTO_ROM
char SINTAB[16]=
{128,177,217,245,255,245,217,177,128,
79,39,11,1,11,39,79};
#pragma DATA_SEG DEFAULT
/**************** M A I N *****************/
void main(void)
{
CONFIG = 0x91; // COPD=1 (cop disabled)
PORTA = 0;
DDRA = 0xFF; // all outputs
PTR1 = &SINTAB[0];
SCBR = 0x02; // Baudrate 9600
SCC1 = 0x40;
SCC2 = 0x0C; // RX + TX enabled
for (;;)
{
PORTA = *PTR1++;
if(PTR1 >= &SINTAB[16])
PTR1 = &SINTAB[0];
SCS1 = SCS1; // read first status register
SCDR = PORTA;
DELAY();
}/* end loop*/
}
void DELAY(void)
{
iCounter = 60000;
while(iCounter > 0) iCounter--;
}
/****************** end main ***********************/
download the complete C-sourcefiles