Port manipulation on the new Arduino Giga

Hello community! I am new to the Arduino Giga board (released last week), and was wondering if anyone has figured out how to read/set pins through direct port manipulation? And if so some sample code or directions would really help me get started and would be very appreciated. Thanks in advance for any guidance/advice! :slight_smile:

Read the datasheet to STM32H747 controller.

I appreciate your suggestion, I'm a little new to this. If you could tell me what I'm looking for that would really go a long way. If someone could show me how to set one bit and read one bit in any register (pin) I can certainly do the rest. I would like to contribute a lot of useful guides to others long term so everyone can enjoy the new Giga :slight_smile:

Cheatsheet Docs:
Arduino GIGA R1 Cheat Sheet | Arduino Documentation | Arduino Documentation

As Arduino Core for mbed devices is based on MbedOS, it is possible for the operating system to crash while running a sketch. On the GIGA R1, whenever the MbedOS fails, the board does not reset automatically . Instead, if it fails, the onboard red LED will start to blink in a looping pattern of 4 fast blinks and 4 slow blinks.

As far as direct-port manipulations, this puppy is not an AVR with a simplistic core design. Best place to look for this material is within the Arduino-core proper:

GitHub - arduino/ArduinoCore-mbed

Ladies.... Gentlemen.... Here is the code, modify it with whatever port/pin you need! :slight_smile:

void setup(){
  pinMode(7, OUTPUT);
  Serial.begin(9600);
}

void loop(){
  GPIOB->ODR |= 1UL<<4; //set pin 7 high, PortB4
  if((GPIOB->IDR & 1UL<<4) == 1UL<<4){ //check if pin 7 is high, PortB4
    Serial.println("MISSION ACCOMPLISHED!");
    delay(1000);
  }
  delayMicroseconds(1000);
  GPIOB->ODR &= ~1UL<<4; //set pin 7 low, PortB4
  delayMicroseconds(3000);
}

Also FYI for anyone wondering all ARM Cortex-M based Arduinos use memory mapped IO to access regsiters, and all macro definitions from the STM32 datasheet are available in Arduino IO space visibility for your usage.