samueldotj
Newbie level 2
![Newbie level 2](/styles/images/ranks/alevel2.gif)
Hi,
I am a newbie to microcontrollers and starting with a breakout board(Blueboard). I am facing a logic level problem.
I have a simple program which sets GPIO pins to HIGH and then LOW. I measured the voltage during HIGH setting and it is 3.3 V and when LOW is set it is 0. :???: I am expecting a value of 2.7-2.9V when HIGH and 0.2-0.4V when LOW.
Another interesting point is the high logic level voltage measures 3.3V only if the GPIO direction is output. Otherwise (if direction is input) it measures as 2.2V.
There is nothing connected to the GPIO pins.
Could it be hardware problem? Or am I missing something?
Thanks
Samuel
I am a newbie to microcontrollers and starting with a breakout board(Blueboard). I am facing a logic level problem.
I have a simple program which sets GPIO pins to HIGH and then LOW. I measured the voltage during HIGH setting and it is 3.3 V and when LOW is set it is 0. :???: I am expecting a value of 2.7-2.9V when HIGH and 0.2-0.4V when LOW.
Another interesting point is the high logic level voltage measures 3.3V only if the GPIO direction is output. Otherwise (if direction is input) it measures as 2.2V.
There is nothing connected to the GPIO pins.
Code:
#define PINSEL2 (*((volatile unsigned long *) 0x4002C008))
#define PINSEL3 (*((volatile unsigned long *) 0x4002C00C))
#define PINMODE2 (*((volatile unsigned long *) 0x4002C048))
#define PINMODE3 (*((volatile unsigned long *) 0x4002C04C))
#define FIO1DIR (*((volatile unsigned long *) 0x2009C020))
#define FIO1MASK (*((volatile unsigned long *) 0x2009C030))
#define FIO1PIN (*((volatile unsigned long *) 0x2009C034))
#define FIO1SET (*((volatile unsigned long *) 0x2009C038))
#define FIO1CLR (*((volatile unsigned long *) 0x2009C03c))
int main (void)
{
PINSEL2 = 0;
PINSEL3 = 0;
PINMODE2 = 0xAAAAAAAA; /*neither pull-up nor pull-down.*/
PINMODE3 = 0xAAAAAAAA; /*neither pull-up nor pull-down.*/
PINMODE_OD1 = 0;
FIO1DIR = ~0; //all are output
FIO1MASK = 0;
FIO1PIN = ~0; //high
while(1) {
FIO1PIN = ~FIO1PIN;
delay(10000);
}
}
Thanks
Samuel