How can I transmit data from a microcontroller to a PC using a PIC16F690?

Click For Summary
SUMMARY

The discussion focuses on transmitting data from a PIC16F690 microcontroller to a PC using asynchronous serial communication. Key steps include initializing the SPBRGH and SPBRG registers for baud rate control, enabling the asynchronous serial port, and loading data into the TXREG register to initiate transmission. The comprehensive serial communication section of the PIC16F690 data sheet provides detailed guidance for setting up the transmission process. Users have successfully utilized these methods, although challenges may arise when interfacing with different operating systems like Windows XP.

PREREQUISITES
  • Understanding of PIC16F690 microcontroller architecture
  • Familiarity with asynchronous serial communication protocols
  • Knowledge of baud rate configuration and register settings
  • Basic programming skills for microcontroller applications
NEXT STEPS
  • Study the PIC16F690 data sheet, focusing on the EUSART Baud Rate Generator section
  • Learn about configuring serial communication in embedded systems
  • Explore methods for interfacing microcontrollers with PCs using USB or RS-232
  • Investigate troubleshooting techniques for serial communication on Windows XP
USEFUL FOR

Electronics hobbyists, embedded systems developers, and anyone interested in microcontroller data transmission techniques.

El Moriana
Messages
33
Reaction score
0
Hi,

I am brand new to micro-controllers, but have thus far been able to do basic programing of one.

I have now reached a stage where I would like to transmit data from the micro-controller to my PC; in this particular case, the number stored in a register of a PIC16F690. Unfortunately I have no clue how this may be done. If someone could give me a little guidance, it would be greatly appreciated.
 
Engineering news on Phys.org
I haven't used that chip, but looking at the data sheet, it has plenty of possibilities for communication with a PC.

It has asynchronous and synchronous serial ports with baud rate control and it has an 8 bit port (port C) with the 8 bits each represented as an output pin.
So, you could directly drive these pins and control the voltages on them.

I have used a parallel port on a computer to read such outputs, but I think I had trouble trying to do it under Windows XP.

The serial communication section in the data sheet is very comprehensive and would be a possible way to go:

Asynchronous Transmission Set-up:
1. Initialize the SPBRGH, SPBRG register pair and
the BRGH and BRG16 bits to achieve the desired
baud rate (see Section 12.3 “EUSART Baud
Rate Generator (BRG)”).
2. Enable the asynchronous serial port by clearing
the SYNC bit and setting the SPEN bit.
3. If 9-bit transmission is desired, set the TX9 control
bit. A set ninth data bit will indicate that the 8
Least Significant data bits are an address when
the receiver is set for address detection.
4. Enable the transmission by setting the TXEN
control bit. This will cause the TXIF interrupt bit
to be set.
5. If interrupts are desired, set the TXIE interrupt
enable bit of the PIE1 register. An interrupt will
occur immediately provided that the GIE and
PEIE bits of the INTCON register are also set.
6. If 9-bit transmission is selected, the ninth bit
should be loaded into the TX9D data bit.
7. Load 8-bit data into the TXREG register. This
will start the transmission.

Easy as that! :)

.
 

Similar threads

Replies
3
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
4
Views
5K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
8
Views
4K