2011-12-15 03:12 PM
I have and LCD screen that requires a positive threshold of 3.5 volts for logic high and the discovery board is only putting out 3.3V for high is there a way to change this on the board or will i need just to add some other hardware to shift the logic level to 5 volts
#3.3v-to-5v-volts #3.3v-to-5v-volts2011-12-15 04:22 PM
For the 5V tolerant pins, you can program them to use open-drain mode, instead of push-pull, and then pull up to 5V with a suitable resistor. The output will then swing from clamped to GND for LOW, and the PULL-UP VOLTAGE for HIGH.
2011-12-15 09:31 PM
2011-12-16 07:21 AM
I've tried this and it goes from ground to about 3.4V not 5V. I've switched to open drain mode and have (5V->10k resistor -> GPIOA 1) i measure at GPOIA 1 and it is always at 3.4V changing the resistance had no effect on the voltage.
But PA.01 isn't a FT (FIVE VOLT TOLERANT) pin is it? Try it with PC.06, or PC.07, or PA.08 thru 15 if you're wedded to GPIOA
2013-05-07 06:30 AM
hi clive
I tried your method to open drain mode ..I connected GPIO_Pin_10(port A) with resistance to 5v of my STM32F4 .. but it does not work, I always have 5v on GPIOA_PIN_10 even if I did a ''GPIO_ResetBits (GPIOA, GPIO_Pin_10)'' ..!2013-05-07 07:20 AM
Without knowing what processor, or seeing the code, I can't help you much.
If a peripheral doesn't respond, check it's being clocked.2013-05-07 08:08 AM
here is my code..:
#include ''stm32f4_discovery.h''
GPIO_InitTypeDef GPIO_InitStructure;
void Delay(__IO uint32_t nCount);
int main(void)
{
/* GPIOA Periph clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
/* Configure PA10 in output OD mode */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStructure);
while (1)
{
GPIO_SetBits(GPIOA, GPIO_Pin_10);
Delay(0xFFFFFF);
GPIO_ResetBits(GPIOA, GPIO_Pin_10);
Delay(0xFFFFFF);
}
}
void Delay(__IO uint32_t nCount)
{
while(nCount--)
{
}
}
2013-05-07 11:19 AM
Doesn't look problematic. I might choose PA8 on the STM32F4-Discovery as it's less conflicted.
47K pull up to 5V?2013-07-10 12:00 AM
Thank you Mr Clive1,your suggestion worked with my STM32F0discovery board.
2013-07-10 09:37 AM
Best if you drive the pin low and keep it low.
then change the direction. Set as Output will pull it low. Set as Input the resistor will pull it high. Be careful of the R/C. High values of R will draw less power but may have rise time issues.