Good morning all, i recently bought a T4.1 and by looking at this page https://www.pjrc.com/teensy/pins.html i tried to control all of the output pin using DDR and PORT registers, just like I was working whit arduino, Yet, i found out running this simple program and checking the pins with a logic probe, that there were a lot of pin not covered by any PORT or DDR register.
byte state = 0x00;
void setup() {
DDRC= 0xFF;
PORTC = 0x0000;
}
void loop(){
state = 0xFF - state;
PORTC = state;
delay(150);
}
In this example i periodically toggle all PORTC, which turned out to be linked to pins 14 to 19. I did the same with PORTC and PORTD. Apparently PORTA doesn't exist since Teensyduino refuses to compile. Anyway, the only gpio ports that i found was B, C, D, yet i wasn't able to cover all of the digital pins. I took a look at the reference manual of the uC and i found that apparently all of those registers are 32 bits wide, so maybe i just wasn't toggling them. But as i tried a 32 bits version of the simple program nothing changed. Does any of you have any info on how to address digital pins using DDR and PORT register? Thanks guys!
byte state = 0x00;
void setup() {
DDRC= 0xFF;
PORTC = 0x0000;
}
void loop(){
state = 0xFF - state;
PORTC = state;
delay(150);
}
In this example i periodically toggle all PORTC, which turned out to be linked to pins 14 to 19. I did the same with PORTC and PORTD. Apparently PORTA doesn't exist since Teensyduino refuses to compile. Anyway, the only gpio ports that i found was B, C, D, yet i wasn't able to cover all of the digital pins. I took a look at the reference manual of the uC and i found that apparently all of those registers are 32 bits wide, so maybe i just wasn't toggling them. But as i tried a 32 bits version of the simple program nothing changed. Does any of you have any info on how to address digital pins using DDR and PORT register? Thanks guys!