UART Remappable Pins
When using a newer device, while the advantages are the enhanced features knowing how to configure and map the pins correctly is become an essential need to know.
In this topic, we will look briefly at the PIC16F1709 and the PIC16F18345 and how to configure the remappable pins to use the device.
This topic is best used in conjunction with the Radix Nano 20A or Radix Nano 20B
If you are a PIC16F690 user, you may have noticed that the PIC16F18344 has been recommended as an alternative device. This new device forms part of an exciting family of devices that offers a range of options.
Read more in our Pass the Torch - Part 1 : Recommendations๏ปฟ series of articles.
The PIC16F690, much like its era-cousin the PIC16F887 is a firm favorite in developing applications, and there is a lot of sample code available. When moving to the new device, you would have realized that the COMPORT is no longer hard-wired, but rather it has to be mapped to be used.
Previously, configuring the comport was simpler and only required initializing the port as shown below.
To configure the comport for remappable PINS, the mapping must be performed. The process includes a little digging in the data sheet, which will be covered at a later stage.
In our second sample, we will demonstrate the changes.
Step 1: Remove the IO Lock
Step 2 : Configure the respective Tris registers
Step3: Configure the PINs
Step 4: Re lock the IO
To use and implement the remappable com port, the full code sample is provided below:
๏ปฟ
As with many of the newer devices, there is a higher level of complexity to the devices. This translates into some additional work in learning the new device, but the enhancements provided in the new devices is well worth the effort.