REsetting microcontroller

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

REsetting microcontroller

Jump to solution
1,822 Views
sam
Contributor I
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 */
}
Labels (1)
Tags (1)
0 Kudos
1 Solution
314 Views
peg
Senior Contributor IV

Hi sam,

Haven't studied your code to thoroughly, but a quick scan looks OK.

Usually the fastest way to reolve this is to do a single stepped full chip simulation. The simulator may even spell out the problem for you when it occurs. Or at the least you (or maybe us?) will know where to look harder.

Regards David

 

View solution in original post

0 Kudos
1 Reply
315 Views
peg
Senior Contributor IV

Hi sam,

Haven't studied your code to thoroughly, but a quick scan looks OK.

Usually the fastest way to reolve this is to do a single stepped full chip simulation. The simulator may even spell out the problem for you when it occurs. Or at the least you (or maybe us?) will know where to look harder.

Regards David

 

0 Kudos