Skip to main content
abogani9
Associate II
June 9, 2009
Question

STM8S/128-EVAL/A Switch to HSE as Clock don't work

  • June 9, 2009
  • 8 replies
  • 2832 views
Posted on June 09, 2009 at 08:21

STM8S/128-EVAL/A Switch to HSE as Clock don't work

    This topic has been closed for replies.

    8 replies

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

    Hi All,

    Excuse me for my bad english.

    On my desk there is an STM8S/128-EVAL/A evaluation board that until now work great. I have just flashed CLK_ClockSelection example from STM8S firmware library and it isn't work!

    The CLK_ClockSwitchConfig() function don't work when i request to switch clock source to HSE. There arent' no problems if i request to swith clock source to HSI or LSI. So seems to me that the real problem is HSE because when i switch to this Evaluation board react rebooting or freezing.

    Anyone could comfirm me that this example work on his board(in this case mine is broken)?

    Thanks!

    Ciao,

    Alessio

    mozra27
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:03

    Hi Bogani,

    Are you sure that the ''Flash_Wait_States'' option byte is set to 1 before using the HSE clock?

    Regards

    mozra

    bassinux
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:03

    Hi,

    I suggest to to try another Quartz for the Eval or it can be badly insert,

    because When you say that Eval is freezing or reboot, it's means that the system doesn't find any Clock source to execute instructions so the system is reset, in other word the clock switch happened but it doesn't find the HSE clock, in my opinion it can be a quartz problem.

    Best Regards

    Bassinux

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

    Hi Mozra,

    Option byte is configured as STVP default except for LSI_EN (which I set to available) and Wait state (which I set to 1).

    I have just found the problem. As bassinux has suggested the Crytal case was slightly un-plugged (that i haven't noticed).

    Thanks Mozra and Bassinux for you help!!!

    Ciao,

    Alessio

    mozra27
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:03

    Hi All,

    Resume: to make the HSE (24 MHz) works fine you should:

    - Plug the crystal

    - Set the ''Flash_Wait_States'' option byte to 1

    - Call the CLK_ClockSwitchConfig() function to switch clock source to HSE

    [English Mode ON]

    :-[ I don't understand

    [English Mode OFF]

    Regards

    mozra

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

    Hi Fangelin,

    I can confirm that now HSE works as expected on my board (i.e. STM8/128-EVAl/A with STM8S208MB microprocessor) whether I'm using my code or firmware library examples.

    [Italian Mode ON]

    Notare che nelle esempio a corredo della firmware library invece il codice che usa HSE è tutt'altro che commentato.

    [Italian Mode OFF]

    Ciao,

    Alessio

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

    We have four STM8/128-EVAL in our lab: none of these work properly with the 24 MHz mounted crystal. So we replaced it with a 16 MHz one, that works fine.

    In effetti è curioso che nel sorgente della demo la linea che abilita l'oscillatore esterno sia stata commentata...

    Ciao

    Francesco

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

    Hi Alessio,

    you were right, we lost the 1 wait state in the option byte setting!

    Many thanks

    Francesco