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

AI Thread Summary
To transmit data from a PIC16F690 microcontroller to a PC, utilize its asynchronous serial communication capabilities. Begin by configuring the baud rate using the SPBRGH and SPBRG registers, and enable the serial port by adjusting the SYNC and SPEN bits. For 9-bit transmission, set the TX9 control bit and enable transmission with the TXEN bit. Load the 8-bit data into the TXREG register to initiate the data transfer. The comprehensive serial communication section in the data sheet provides detailed guidance for successful implementation.
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! :)

.
 
Very basic question. Consider a 3-terminal device with terminals say A,B,C. Kirchhoff Current Law (KCL) and Kirchhoff Voltage Law (KVL) establish two relationships between the 3 currents entering the terminals and the 3 terminal's voltage pairs respectively. So we have 2 equations in 6 unknowns. To proceed further we need two more (independent) equations in order to solve the circuit the 3-terminal device is connected to (basically one treats such a device as an unbalanced two-port...
suppose you have two capacitors with a 0.1 Farad value and 12 VDC rating. label these as A and B. label the terminals of each as 1 and 2. you also have a voltmeter with a 40 volt linear range for DC. you also have a 9 volt DC power supply fed by mains. you charge each capacitor to 9 volts with terminal 1 being - (negative) and terminal 2 being + (positive). you connect the voltmeter to terminal A2 and to terminal B1. does it read any voltage? can - of one capacitor discharge + of the...
Back
Top