I'm having trouble finding information that details how the ODR and IDR (maybe BSRR) are connected to the actual pins on the device.
Does anybody know where I can find the plans for that, or how to figure this out short of trying everything on my own?
I bought the arduino thinking this stuff would be easier, rather than harder 
Summary
Input data register, output data register, bit set/reset register. I'm interested in direct manipulation because the arduino functions are too slow.
Hi,
I'm working on the same thing.
So far, I have a Document and some responses back from my Post that look promising.
I plan on poking around a bit this weekend and I will let you know if I have any results that make since.
Did you find out anything?
Thanks Paul
1 Like
Hi Paul,
I shelved the project, but I'd be super interested if you find anything!
thanks 
Depending on what the default (RESET) states of the registers, you can "SET" or "CLEAR" their corresponding MODER register
In this example, to change PINA6 after reset
// OUTPUT MODE
GPIOA->MODER |= 1<<12; // PIN6 is in MODER6[1:0]
// ALTERNATE FUNCTION
GPIOA->MODER |= 2<<12; // PIN6 is in MODER6[1:0]
// ANALOG
GPIOA->MODER |= 3<<12; // PIN6 is in MODER6[1:0]
Then use the BSRR register to "SET" or "RESET"
// CLEAR or RESET
GPIOA->BSRR = 1<<22;
// SET
GPIOA->BSRR = 1<<6;
You have to check the GPIO section of your MCU manual
//********************
//********************
//********************
// This Program Outputs a Byte to "GIOJ" Ports: D38 (PJ7), D37 (PJ6), D35 (PJ5), D33 (PJ4), D31 (PJ3), D29 (PJ2), D27 (PJ1), D25 (PJ0)
//********************
//********************
//********************
//Set Byte_Test to Word for "Serial.println"
word Byte_Test;
void setup() {
Serial.begin(9600);
Serial.println("Encoder Test --> Giga Direct Port Manipulation!!!");
//********************
//********************
//********************
//Set Desired Byte Pins to OUTPUT
pinMode(25, OUTPUT);
pinMode(27, OUTPUT);
pinMode(29, OUTPUT);
pinMode(31, OUTPUT);
pinMode(33, OUTPUT);
pinMode(35, OUTPUT);
pinMode(37, OUTPUT);
pinMode(38, OUTPUT);
}
void loop() {
//Serial.println("Encoder Test Giga Direct Port Manipulation!!!");
//********************
//********************
//********************
//Copy 'n' Paste Code that Actually Works!!!!
//GPIOJ->ODR = (0b00000001); // Turns on: D25 (PJ0)
//GPIOJ->ODR = (0b00000010); // Turns on: D27 (PJ1)
//GPIOJ->ODR = (0b00000011); // Turns on: D27 (PJ1), D25 (PJ0)
//GPIOJ->ODR = (0b00000100); // Turns on: D29 (PJ2)
//GPIOJ->ODR = (0b00000101); // Turns on: D29 (PJ2), D25 (PJ0)
//GPIOJ->ODR = (0b00000110); // Turns on: D29 (PJ2), D27 (PJ1)
//GPIOJ->ODR = (0b00000111); // Turns on: D29 (PJ2), D27 (PJ1), D25 (PJ0)
//GPIOJ->ODR = (0b00001000); // Turns on: D31 (PJ3)
//GPIOJ->ODR = (0b00001001); // Turns on: D31 (PJ3), D25 (PJ0)
//GPIOJ->ODR = (0b00001010); // Turns on: D31 (PJ3), D27 (PJ1)
//GPIOJ->ODR = (0b00001011); // Turns on: D31 (PJ3), D27 (PJ1), D25 (PJ0)
//GPIOJ->ODR = (0b00001100); // Turns on: D31 (PJ3), D29 (PJ2)
//GPIOJ->ODR = (0b00001101); // Turns on: D31 (PJ3), D29 (PJ2), D25 (PJ0)
//GPIOJ->ODR = (0b00001110); // Turns on: D31 (PJ3), D29 (PJ2), D27 (PJ1)
//GPIOJ->ODR = (0b00001111); // Turns on: D31 (PJ3), D29 (PJ2), D27 (PJ1), D25 (PJ0)
// *
// *
// *
//GPIOJ->ODR = (0b11111111); // Turns on: D38 (PJ7), D37 (PJ6), D35 (PJ5), D33 (PJ4), D31 (PJ3), D29 (PJ2), D27 (PJ1), D25 (PJ0)
//********************
//********************
//********************
//Set GIPO "J" Port to Desired Byte
//This Turns On / Off Desired Digital Ports
GPIOJ->ODR = (0b00000111); // Turns on: D29 (PJ2), D27 (PJ1), D25 (PJ0)
//Set "Byte_Test" to Desired Byte
Byte_Test = (GPIOJ->ODR);
//Prints "Byte_Test" to "Serial Monitor" in HEX
Serial.println( Byte_Test, HEX );
}
1 Like
Hi,
After Hours and Hours of Research, I wrote this Working Program for use on the GIGA Board.
Let me know if you have any Questions.
Thanks Paul
1 Like