# Port manipulation on due board

**URL:** <https://forum.arduino.cc/t/port-manipulation-on-due-board/280874>\
**Category:** Due\
**Created:** [January 8, 2015, 4:34pm UTC](https://forum.arduino.cc/t/port-manipulation-on-due-board/280874 "2015-01-08T16:34:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pchatill](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@pchatill](https://forum.arduino.cc/u/pchatill)\
**Post date:** [January 8, 2015, 4:34pm UTC](https://forum.arduino.cc/t/port-manipulation-on-due-board/280874/1 "2015-01-08T16:34:07Z")

</div>

Hello.

I'm trying to use the functions for port manipulation.

In this forum, I saw interesting informations from MarkT

He said:

PIO\_PER - write 1's here to override other peripherals and allow GPIO use for pins  
PIO\_OER - write 1's here to set pins as OUTPUT  
PIO\_ODR - write 1's here to set pins as INPUT

- PIO\_SODR - write 1's here to set output pins HIGH
- PIO\_CODR - write 1's here to set output pins LOW
- PIO\_PDSR - read's actual state of the pins on the port.  
PIO\_PUDR - write 1's here to switch off internal pull-up for pins  
PIO\_PUER - write 1's here to switch on internal pull-up for pins

But Is that possible to read this values? and what is the syntax?  
I want to know if a pin is INPUT or OUTPUT, and low or high because my arduino is interfaced  
with a home system automation who can change the pins (values and status)

Thanks for your help  
Patrick

PS: not easy to find informations on port manipulation on due ...

---

<div class="post-metadata">

**Author:** ![abhijitst](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@abhijitst](https://forum.arduino.cc/u/abhijitst)\
**Post date:** [January 9, 2015, 12:30pm UTC](https://forum.arduino.cc/t/port-manipulation-on-due-board/280874/2 "2015-01-09T12:30:25Z")

</div>

Hi Patrick,

I found following link which you can refer to check if pin is High / Low.

> **[digitalRead() - Arduino Reference](https://www.arduino.cc/reference/en/language/functions/digital-io/digitalread/)**
>
> The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.

Not sure about, how to check if pin is input or output. Normally we set pin as input /output and then use it accordingly.

Thanks and Regards,  
Abhijit

---

<div class="post-metadata">

**Author:** ![MarkT](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@MarkT](https://forum.arduino.cc/u/MarkT)\
**Post date:** [January 9, 2015, 1:51pm UTC](https://forum.arduino.cc/t/port-manipulation-on-due-board/280874/3 "2015-01-09T13:51:05Z")

</div>

Look at the source code for digitalRead/Write!! This is open source, you have all the code!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 5:39pm UTC](https://forum.arduino.cc/t/port-manipulation-on-due-board/280874/4 "2021-05-06T17:39:42Z")

</div>

Closed on May 6, 2021, 5:39pm UTC


