# Enable Tx and Rx (dig pin 1 and pin 0)

**URL:** https://forums.sifive.com/t/enable-tx-and-rx-dig-pin-1-and-pin-0/1499
**Category:** HiFive1 Rev B
**Created:** [August 11, 2018, 6:16am UTC](https://forums.sifive.com/t/enable-tx-and-rx-dig-pin-1-and-pin-0/1499 "2018-08-11T06:16:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@daniel](https://forums.sifive.com/u/daniel)
#### Post date: [August 11, 2018, 6:16am UTC](https://forums.sifive.com/t/enable-tx-and-rx-dig-pin-1-and-pin-0/1499/1 "2018-08-11T06:16:08Z")

</div>

I want to do some uart communication establishment between r307 finger print scanner and hifive1.I just wrote some code ,correct me if am wrong

//clock config  
PRCI\_REG(PRCI\_HFROSCCFG) |= ROSC\_EN(1);

PRCI\_REG(PRCI\_PLLCFG) = (PLL\_REFSEL(1) | PLL\_BYPASS(1));  
PRCI\_REG(PRCI\_PLLCFG) |= (PLL\_SEL(1));

PRCI\_REG(PRCI\_HFROSCCFG) &= ~(ROSC\_EN(1));

GPIO\_REG(GPIO\_IOF\_SEL) &= ~IOF\_UART0\_TX;  
GPIO\_REG(GPIO\_IOF\_EN) |= IOF\_UART0\_TX

GPIO\_REG(GPIO\_IOF\_SEL) &= ~IOF\_UART0\_RX;  
GPIO\_REG(GPIO\_IOF\_EN) |= IOF\_UART0\_RX;

//set 115200 Baud Rate  
UART0\_REG(UART\_REG\_DIV) = 138;  
UART0\_REG(UART\_REG\_TXCTRL) = UART\_TXEN;  
UART0\_REG(UART\_REG\_RXCTRL) = UART\_RXEN;

…  
…  
I want to see the o/p in hyper terminal like gtk term .As i read the document ,it tells like the following

* * *

When a pin is set to perform an IOF, it is possible that the software registers **port** , **output en** ,  
**pullup** , **ds** , **input en** may not be used to control the pin directly. Rather, the pins may be con-  
trolled by hardware driving the IOF. Which functionalities are controlled by the IOF and which are controlled by the software registers are fixed in the hardware on a per-IOF basis. Those that are  
not controlled by the hardware continue to be controlled by the software registers.

* * *

so my question is what should i do to see the o/p that i am getting it from Rx pin in the terminal ??

is doing this correct?  
// GPIO\_REG(GPIO\_OUTPUT\_VAL) |= IOF\_UART0\_RX;  
// GPIO\_REG(GPIO\_OUTPUT\_EN) |= IOF\_UART0\_RX;

And can i send commands to tx and receive ack data from rx through write and read function which is given in the freedom e sdk/bsp/libwrap/sys?
