Hi all, I couldn't find any results for this, so I thought I'd ask here.
I've been playing with this Teensy using Teensyduino, and was trying to figure out my some of my pins on PORTF weren't behaving properly. Basically, PORTF 0-3 can be toggled low or high with no trouble, but 4-7 always stay HIGH, no matter what. I've tried port manipulation, pinMode, setting as input...but they always stay high. I checked the documentation and couldn't see what was wrong here. my test code is just a switch case, testing different methods of controlling the pins, but like I said PF4-PF7 don't respond.
None of the above do anything to the pins PF4-PF7.
Anyone able to tell me what might be going on?
I've been playing with this Teensy using Teensyduino, and was trying to figure out my some of my pins on PORTF weren't behaving properly. Basically, PORTF 0-3 can be toggled low or high with no trouble, but 4-7 always stay HIGH, no matter what. I've tried port manipulation, pinMode, setting as input...but they always stay high. I checked the documentation and couldn't see what was wrong here. my test code is just a switch case, testing different methods of controlling the pins, but like I said PF4-PF7 don't respond.
Code:
void loop() {
// put your main code here, to run repeatedly:
char input = Serial.read();
switch (input)
{
case 'T':
DDRF = 0xFF; //output
PORTF = 0x00; //set low
break;
case 'Q':
pinMode(42, OUTPUT); //pin 42 is PF4 according to documentation
digitalWrite(42, LOW);
break;
case 'E':
pinMode(42, INPUT);
break;
case 'F':
pinMode(41, OUTPUT); //pin 41 is PF3 according to documetation
digitalWrite(41, HIGH);
break;
case 'J':
DDRF = 0xFF; //SET OUTPUT
PORTF = 0xFF; //TURN ALL PINS HIGH
break;
case 'H':
DDRF = 0x00; //SET AS INPUT
break;
}
}
Anyone able to tell me what might be going on?
Last edited by a moderator: