Topic : ADC and timer questions

Forum : ST7/STM8

Original Post
Post Information Post
November 19, 2009 - 4:20pm
Guest

Hi!

I have a problem with the ADC, I want to switch between references, sometimes I want to use Vdd/Vss and sometimes Vref+ and Vref- but without hardware configuration change, during program execution. Is this posible? what is the register bit where I can choose the reference, or it doesn´t exists? I have worked with other MCUs and they have this option.

Another thing, I am trying to simulate my program with the simulator and the timer interrupt doesn´t work fine, I have tried a lot of configurations but nothing, I thing that this may work:


  
    CLK_PeripheralClockConfig(CLK_PERIPHERAL_TIMER4, ENABLE); 
    TIM4_TimeBaseInit(TIM4_PRESCALER_1, 0xFF);
    TIM4_SetCounter(0x00);
    TIM4_ITConfig(TIM4_IT_UPDATE, ENABLE);
    TIM4_Cmd(ENABLE);

I try different breakpoints an I realize that the counter registers don´t count, so is not the interrupt, I thing I am doing something wrong but I don´t know what!, pleas help me

Thank you!!

Replies
Post Information Post
+1
0
-1
November 20, 2009 - 2:17pm
Raisonance Support Team

Hi Alberto,

It looks like you are working on an STM8. It is not possible to change VRef+/- by software.
You may ask the ST support guys (ST forum), which may have ideas about how to handle your issue.

Regards,
Bruno

+1
0
-1
November 20, 2009 - 2:26pm
Guest

ok thank you very much I try to ask them, and about the timer simulation? what I am doing wrong?

sorry, you are right I am working with STM8207