AnsweredAssumed Answered

REsetting microcontroller

Question asked by joji joker on May 20, 2006
Latest reply on May 21, 2006 by David Payne
When i write serial communcation programme for receving jl8(hc08)Whene it get a character microcontroller get reseting i attach serial communcation programme with it


void INIT_SCI(void)
{
SCBR_SCR = 2; // for 9600 ...........
SCBR_SCP = 0; //

SCC1 = 0x44; //Enable the SCI peripheral
SCC2 = 0x2C; //Enable the SCI receiver/Transmiter

SCDR = 'A'; //Dummy data transfer
SCC2_TE = 1; //To wakeup reciever
while(!SCS1_TC){}; //Wait for tx completion
SCC2_TE = 0;
}

void justdebug(char c)
{
SCDR = c;
SCC2_TE = 1;
while(!SCS1_TC){};
SCC2_TE = 0;

}

interrupt 13 Recieve_isr(void)
{
asm lda SCS1;

justdebug(SCDR);

}


void main(void)
{
unsigned char c=0xff;
CONFIG1 = 0x01; //COP disabled
CONFIG2 = 0x08; //LVI enabled - 2.4V
INIT_SCI();
EnableInterrupts; /* enable interrupts */
/* include your code here */
justdebug('R');

for(;:smileywink: {



} /* loop forever */
/* please make sure that you never leave this function */
}

Outcomes