cancel
Showing results for 
Search instead for 
Did you mean: 

SM8L101(K3) Hello world example.... issue

gege089
Associate
Posted on December 26, 2011 at 21:32

Hi there !

I am a

newbie

in ST microcontroller. 1) Tobeginning, I bought : * A

http://www.st.com/internet/evalboard/product/251jsp

(with a stm8l101K3 MCU) * A

http://www.raisonance.com/tzr/scripts/resizer.php?filename=T018/image/10/a5/4cn9ziz4bnx6&mime=image/jpeg&geometry=297x>;

kit (with the Ride7developmentenvironment) 2)

So, my issue:

programming a hello world soft

for my MCU. In other words: To make a short software to

detect an analog input DC voltage

(3.3V DC on comparative inputs ) 3) What I have already done:

#include ''stm8l10x.h''
#define MyGPIO (GPIOB)
#define MyPin(GPIO_Pin_All)
void
main(
void
){
uint8_t C=0;
uint8_t My;
while
(1) { 
GPIO_DeInit(MyGPIO);
GPIO_Init(MyGPIO, MyPin, GPIO_Mode_In_FL_No_IT);
My = GPIO_ReadInputDataBit(MyGPIO, MyPin);
C++;
}
}

But : When I run this example, and use a strap to powereed with a 3.3 V DC inputs of the MCU, nothings occurs... Just the unint8_t C counter works.

Anybody can explain-me how to develop a simple soft to detect the input voltage in an analog input pin of the MCU ?

NB: Yes, I havealready downloaded some example in the internet (st website and ride example). The main issue for myself is tounderstandhow a microcontroller works, I2C, SPI, comparator etc. I have just one experience with MCU (mbed NXP product). Regards, GM #stm8l101 #stm8 #c/c+ #st #analog
0 REPLIES 0