I'm trying to interface a PIC16F627A MCU to a PC (running Linux) via an RS-232 serial interface.
I've chosen to use the 16F627A as it has on-board USART. Presumably the easiest method for comms is for me to use this in asynchronous mode?
I'm a little confused by the values of SPBRG given in the table within the Microchip PDFs (https://ww1.microchip.com/downloads/en/DeviceDoc/31018a.pdf). I intend to run the chip from its internal oscillator (~4MHz) and I want my baud rate to be 9.6k. In table 18-4 and 18-5 (i.e. for when BRGH is 0 and 1 respectively); if Fosc = 4MHz and baud rate = 9.6k, the values for SPBRG are shown as 'NA' (which I'm taking to be not available or not applicable).
Does this mean that I can't run at 9600 baud using the internal oscillator?
is that you have to consider what you are doing.
With your chosen clock speed of 4mhz the way that translates down to the speed of 9600 baud means it cannot create all the needed transmission pulses in the time allowed.
You will either have to increase your oscillator frequency or decrease your baud rate.
See this tutorial for a good explanation - in the download files for that lesson version 7.7a is the hardware example which does work well. http://www.winpicprog.co.uk/pic_tutorial7.htm