Skip to main content
keskintaylan
Associate
November 24, 2009
Question

STM8S103F2 TIMER EXAMPLE(needed please)

  • November 24, 2009
  • 11 replies
  • 2392 views
Posted on November 24, 2009 at 06:49

STM8S103F2 TIMER EXAMPLE(needed please)

    This topic has been closed for replies.

    11 replies

    keskintaylan
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 15:05

    I did it, yeah i did it! :-]

    The problem is weird...:

    I disassemble the code. I check this '' TIM2->IER = 1; '' and i see in disassembler '' MOV 0x5301,#0x01 '' but TIM2 interrupt register address is 0x5303. Then i check STM8S.h -> I found there :

    typedef struct TIM2_struct

    {

    vu8 CR1;

    #if defined STM8S103

    vu8 RESERVED1;

    vu8 RESERVED2;

    #endif

    vu8 IER;

    vu8 SR1;

    .

    .

    .

    .

    }

    Then i realize that the compiler don't see reserved bits.Thus IER's address was 5301. So i remove defines and tataaa... program worked.

    But still i don't understand why compiler passover reserved bits? Why ''#if defined STM8S103'' didn't work?

    Thank you anyway mozra...

    [ This message was edited by: keskintaylan on 21-11-2009 13:19 ]