REsetting microcontroller

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

REsetting microcontroller

ソリューションへジャンプ
2,392件の閲覧回数
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 */
}
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
884件の閲覧回数
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 件の賞賛
返信
1 返信
885件の閲覧回数
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 件の賞賛
返信