TFcroft4 0 Posted June 24, 2014 Report Share Posted June 24, 2014 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. Thanks Quote Link to post Share on other sites
Sparky1039 0 Posted June 25, 2014 Report Share Posted June 25, 2014 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). Quote Link to post Share on other sites
JorgeF 0 Posted June 25, 2014 Report Share Posted June 25, 2014 Hi 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 Jorge Quote Link to post Share on other sites
TFcroft4 0 Posted June 25, 2014 Author Report Share Posted June 25, 2014 Thanks for the replies. I noted this text in the rs232_driver.h which specifically says software emulation. I am confused Ted ////////////////////////////////////////////////////////////////////////////// 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//////////////////////////////////////////////////////////////////////////// Quote Link to post Share on other sites
Recommended Posts
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.