cancel
Showing results for 
Search instead for 
Did you mean: 

What's matter about EMI of stm8a?

wolver
Associate II
Posted on April 30, 2009 at 10:48

What's matter about EMI of stm8a?

12 REPLIES 12
wolver
Associate II
Posted on May 17, 2011 at 15:03

Hi Jatin

I find the focus of Flash was changed...

When programm run normally, Then make the crystal stop to self_oscillate(Such as: finger touch crystal pin) a moment...poweroff...poweron...The flash was changed, programm did not go on.

I used some code at beginning of main() as follow:

//-----------

int main(void)

{

_asm(''sim\n''); // Disable interrupt

FLASH_PUKR = 0x00; // LOCK flash

RST_SR = 0x1F; // Clear reset flag

CLK_CKDIVR = 0x00; // HSI_DIV = 1; HSE_DIV = 1

CLK_ECKR = 0x01; // HSE clock on

CLK_SWCR = 0x06; // Enable switch and interrupt

CLK_SWR = 0xB4; // HSE as the master clock.

_asm(''rim\n''); // Enable interrupt

while(!gFlag_run);

......

return 0;

}

//------------

volatile unsigned char gFlag_run = 0;

@near @interrupt void CLK_IRQHandler(void)

{

CLK_SWCR &= ~0x08; // clear SWIF

gFlag_run = 1; // Set run flag

return;

}

//------------

But the Devil is still live.

Regards

wolver

wolver
Associate II
Posted on May 17, 2011 at 15:03

Hello

Faint! The evil was killed...When I kick out 'static @inline' key of all fuctions declare. That wiil be appreciated from the mail of Joyce Yan Mentioned it!

Thanks for help of all ST Engineers, STM8A is good 8bit MCU, But I am not sure Whether STVD(Comsic) need be improved ...The dangerous of flash changed has be resolved Completely?

Regards

wolver

:p

[ This message was edited by: wolver on 29-04-2009 19:44 ]

jatin
Associate II
Posted on May 17, 2011 at 15:03

Glad to know that the problem is solved at your end.

But we would like to investigate it in detail. Joyce will contact you for this.

Thanks

Regards,

Jatin