cancel
Showing results for 
Search instead for 
Did you mean: 

STM8A do not work in 24MHz?

wolver
Associate II
Posted on April 24, 2009 at 12:25

STM8A do not work in 24MHz?

7 REPLIES 7
wolver
Associate II
Posted on May 17, 2011 at 15:02

Hello

Att. is my Schematic diagram.

I test results as follows:

24MHz fault

20MHz good

18.432MHz good

Who can tell me why 24MHz is not work?

Thanks a lot!

regards

wolver

alexanderczajor9
Associate II
Posted on May 17, 2011 at 15:02

Hello Wolver,

did you select 1 waitstate for memory access above 16 MHz ?

Best Regards

Alexander

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

Hello Alexander

I do not understand “select 1 waitstate�...

Could you write source code show me or tell me what page in datasheet?

Thanks!

Regards

wolver

PS: My start some code as follows:

void main(void)

{

_asm(''sim\n'');

delay_ms(50);

system_init();

poweron_init_part();

InternalSRAMDataInit();

_asm(''rim\n'');

put_char('O');

put_char('K');

ModifyCurSystemStatus(NO_CORE_SUPPLY_MCU_IDLE_STATUS);

while(1)

{

ProcessADCKeyValue();

ProcessBitStreamInfo();

ProcessIICRece();

}

}

void system_init(void)

{

CLK_ECKR = 0x03;

CLK_SWCR = 0x02; // Enable switch.

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

while(CLK_SWCR & 0x01); // Waiting for switch ok.

SimIrD_Output(); // PD0

#if 0

CLEARIO();

PD_CR1 |= 0x01; // set output high

#endif

SETIO();

}

mozra27
Associate II
Posted on May 17, 2011 at 15:02

Hi wolver,

Refer to OPT7 description in datasheet page 35.

To set the wait state option byte you should enter in Debug mode and in the MCU Configuration window set the option ''Flash wait states''

Regards

mozra

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

Hi mozra

Programm OPT7=1, It works at 24MHz well.

Thank you!

Best Regards

wolver

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

Hi Wolver,

You can configure the wait state also with the ST Visual programmer in addition to the ST visual debug as mentioned by Mozra.

Regards,

Jatin

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

Hi: Jatin

I do it...See Att. picture...

Regards

wolver