# How to contact uart in pynq‘s ardinuo or PMOD interface?

**URL:** <https://discuss.pynq.io/t/how-to-contact-uart-in-pynq-s-ardinuo-or-pmod-interface/1799>\
**Category:** Support\
**Created:** [September 27, 2020, 3:23am UTC](https://discuss.pynq.io/t/how-to-contact-uart-in-pynq-s-ardinuo-or-pmod-interface/1799 "2020-09-27T03:23:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![VicerExciser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/vicerexciser/32/1643_2.png) [@VicerExciser](https://discuss.pynq.io/u/VicerExciser)\
**Post date:** [October 29, 2020, 9:04pm UTC](https://discuss.pynq.io/t/how-to-contact-uart-in-pynq-s-ardinuo-or-pmod-interface/1799/2 "2020-10-29T21:04:51Z")

</div>

For the Arduino interface, you can use the MicroblazeLibrary class to create a wrapper object in Python that exposes the functions implemented in the PYNQ UART API (in ‘uart.c’). Here’s a very basic example of its usage:

> from pynq import Overlay  
> from pynq.lib import MicroblazeLibrary
> 
> UART\_RXD = 0 ## Arduino pin 0 is RXD  
> UART\_TXD = 1 ## Arduino pin 1 is TXD
> 
> base = Overlay(‘base.bit’)  
> lib = MicroblazeLibrary(base.iop\_arduino, [‘uart’])  
> uart = lib.uart\_open(UART\_TXD, UART\_RXD)
> 
> read\_command = [0xDE, 0xAD, 0xBE, 0xEF]  
> uart.write(read\_command, len(read\_command)) ## Write an iterable list of bytes
> 
> response = [0x00] \* 4  
> uart.read(response, 4) ## Request a 4-byte response
> 
> uart.close()

I don’t believe either of the two Pmod PYNQ Microblaze IOPs have an AXI controller for UART, so Pmod UART may not be supported.

---

_[View the full topic](https://discuss.pynq.io/t/how-to-contact-uart-in-pynq-s-ardinuo-or-pmod-interface/1799)._
