Skip to main content
Visitor II
April 24, 2009
Question

STM8A do not work in 24MHz?

  • April 24, 2009
  • 7 replies
  • 1164 views
Posted on April 24, 2009 at 12:25

STM8A do not work in 24MHz?

    This topic has been closed for replies.

    7 replies

    wolverAuthor
    Visitor II
    May 17, 2011
    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

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hello Wolver,

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

    Best Regards

    Alexander

    wolverAuthor
    Visitor II
    May 17, 2011
    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();

    }

    Visitor II
    May 17, 2011
    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

    wolverAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hi mozra

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

    Thank you!

    Best Regards

    wolver

    Visitor II
    May 17, 2011
    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

    wolverAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hi: Jatin

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

    Regards

    wolver