Help with PIC16F18313

Skip to first unread message

Mar 23, 2022, 3:09:36 PMMar 23
to jallib
Hi all,

I need help configuring the TX pin of this MCU; F18313.
Can anyone help about this?
This pin is not a "stand-alone" function pin. Only RX is available and ready to use.
Am using an FTDI cable for RS232-5V. Tried to use serial_hardware lib with no luck.
Is it more suitable to use serial_software lib instead?
Thank you very much.

Oliver Seitz

Mar 24, 2022, 2:48:23 AMMar 24
Hello fsfo... and welcome to the mail list.

The microchip site states for this chip: "The Peripheral Pin Select (PPS) functionality enables pin mapping..."

I would like to add: enables *and*requires* pin mapping. Some pins will not work without mapping, even if standard locations are described in the datasheet. General rule: don't rely on reset values, define everyting you need.

serial_software will work without pin mapping, but it has a lot of other drawbacks. It's more like a last fallback option in most cases.


Am Mittwoch, 23. März 2022, 20:16:48 MEZ hat <> Folgendes geschrieben:

You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit


Mar 24, 2022, 3:56:36 AMMar 24
to jallib
Thank you for your replies.
Pin mapping is a bit far from my experience. Much probably would need some serious help for that. Thanks addressed also to Rob Hamerling.
Anyways have used serial_software with good results. My USB cable has only RX/TX pins, so it seems working good enough.
Only noticed some misconfigurations about baud rate. Have defined it for 38_400 in PIC code, but have to configure RS232 Terminal for 57600 to receive good data. What else drawbacks I will face using this serial_software library?
Thank you very much for the help.

Filipe Santos

Evan Venn

Mar 24, 2022, 6:13:47 AMMar 24
Setup the PPS using PPSTOOL? 

PPSTOOL is part of Great Cow BASIC but the tool can be used for any compiler.  Just select the capability and select the port - it gens the PPS output for you. 


Rob CJ

Mar 24, 2022, 7:56:07 AMMar 24
Hi Filip,

As Kiste said some PICs require to always set PPS  even for default pin assignments.

An example is given below - for a PIC16F1976 - that shows that works if you use the  JAL PPS library (no need for Great Cow Basic 😉). Of course the names depend on the PIC, you can find them in the device file of your specific PIC.

-- Re-assign the pins. Note: This must always be done to let it work even for
-- the default assignment.
include PPS
RC6PPS = PPS_TX1       -- TX1 re-assigned to C6  (default)            
RX1PPS = PPS_RC7       -- C7 re-assigned to RX1  (default)            
RD3PPS = PPS_TX2       -- TX2 re-assigned to D3      
RX2PPS = PPS_RD2       -- D2  re-assigned to RX2              

Hope this helps.

Kind regards,


Van: 'Evan Venn' via jallib <>
Verzonden: donderdag 24 maart 2022 11:13
Aan: <>
Onderwerp: Re: [jallib] Help with PIC16F18313


Mar 24, 2022, 12:25:42 PMMar 24
to jallib
Thank you all.
Will give PPS lib a try soon.
Now am facing a new problem.
Maybe someone can help here...
My PIC is reading an analog value and send it thru RS232/USB cable.
Can receive the right data, but need it sent to an already open excel spreadsheet.
Cannot make it work. Can send it to notepad anyway, so hardware works ok, except excel interaction.
Many examples I can see in internet and tested, have code to "open" new workbook and that works. But I want to send the values to and already open excel workbook.
Any help would be great.
Thank you once again.

Filipe Santos.
Reply all
Reply to author
0 new messages