Jump to content

Two Serial Ports 1 Hard, 1 Soft For 16F877A

Recommended Posts

I would like to use 2 serial ports on a 16f877a.

One would be receiving data from a GPS module at 9600 and I think would be better using the built in uart.

The second is output only at 2400, sending a data packet of about 30 characters one a second

Is this feasible and if so how would I set this up using the ScourceBoost UART template.



Link to post
Share on other sites

SB UART library is designed only for those PIC's that contain a UART (EUSART) hardware module. See users manual for details. It does not offer software UART capability.


To create you own software UART transmit output, it's really a simple matter of applying a timer set up to generate an interrupt every 416uS indicating when to write a data bit to a port pin (+ start and stop bits too).

Link to post
Share on other sites



There are a number of soft (bit banged) UATs available in the Net, both in 'C' or 'ASM'.

Just choose one with a good explanation and adapt it.


Best regards


Link to post
Share on other sites

Thanks for the replies.


I noted this text in the rs232_driver.h which specifically says software emulation.


I am confused




// Serial Communications Library
// Author(s): Andrew Smallridge
// Date 15 November 2004
// Copyright© 2004-2006 Andrew Smallridge
// Copyright© 2004-2010 Pavel Baranov
// Copyright© 2004-2010 David Hobday
// Existing constants predefined for serial hardware driver and software
// emulation for the PIC 16F87x, PIC18F2xx and 18F4xx processors.
// For hardware support on other PICs the constants must be mapped to
// the corresponding register map of the target device

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...