GPIO driving outside logic
Hello,
I am a student and I am starting my final project a little early, and I am glad I did because I am really confused! I am making a guitar-playing robot that I am going to drive off of this handy-dandy microcontroller. Basicly I am going to put a file similar to a guitar tab in the FLASH memory and have my main C code interpret it and set output pins connected to some extra logic that will eventually drive some solenoids and stepper motors that will play the guitar.
I am having trouble setting the output pin voltage. Here is what I have:
<code>
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_WriteBit(GPIOC, GPIO_Pin_12, Bit_SET);
</code>
I want to be able to set any given output pin to either a high or low voltage to drive external logic. I was under the impression that this code should set the output pin C12 to a high voltage, but when i use a voltmeter to compare it to ground it reads 0 volts. What am I doing wrong?
Any other thoughts? Is reading a file going to be more complicated than standard C file IO?
I am using Atollic TrueSTUDIO STM32 Lite as my dev environment.
Thank you much,
Jack
#gpio #gpio-mode