I am trying to control the pins of PORT B or A, I can control the first 4 pins but not beyond.
Following the table found in this thread, I made a simple example, it should blink a LED set on pin 0:
What is the proper way to control these pins?
Following the table found in this thread, I made a simple example, it should blink a LED set on pin 0:
Code:
//PortA[4:5, 12:13] = {33, 24, 3, 4}
//PortB[0:3, 16:19] = {16, 17, 19, 18, 0, 1, 32, 25}
//PortC[0:11] = {15, 22, 23, 9, 10, 13, 11, 12, 28, 27, 29, 30}
//PortD[0:7] = {2, 14, 7, 8, 6, 20, 21, 5}
//PortE[0:1] = {31, 26}
uint16_t const PIN = 65536; // 2^16 according to the reference table
int led = 0;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
GPIOB_PDOR |= PIN;// pin HIGH
delay(1000); // wait for a second
GPIOB_PDOR &=~ PIN;// pin LOW
delay(1000); // wait for a second
}
What is the proper way to control these pins?