I am attempting to write 0x23 to the first eight bits of PORT C on the Arduino Due. See code below:
void setup() {
// put your setup code here, to run once:
PIOC->PIO_PER = 0xFF; // Configure PORTC to PIO controller, pins 33-40
PIOC->PIO_OER = 0xFF; // Enable PORTC to output
}
void loop() {
// put your main code here, to run repeatedly:
PIOC->PIO_ODSR = 0x23;
}
0x23 should correspond to 00100011 which I thought would set pins 33,34,38 to a HIGH state. To verify this I measured the voltage at each of these pins with a multi-meter. I only got a HIGH state at pins 33 and 37; therefore, there must be something wrong with my code. Can anyone spot the error?
Please continue on the orginal post rather than cross posting to this new one.
I only mention this because multiple posts on the same subject it makes it difficult for other forum users to follow. It also results in duplication, as forum members end up responding to each post separately.
Apologies for bringing it to a new post. I am interfacing a quadrature decoder to the Arduino over an 8 bit bus connected to PORT C and the manufacturer suggested that I write 0x23 to the eight bits connected to that port (33-40). I assume that writing 0x46 would achieve this result?