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

In summary, the data sheet for the PIC16F690 says that it has an asynchronous serial port with baud rate control and that you can directly drive the pins and control the voltages on them.
  • #1
El Moriana
33
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
  • #2
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! :)

.
 

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

1. What is a microcontroller?

A microcontroller is a small computer on a single integrated circuit that is designed to control specific functions and operations. It is commonly used in electronic devices such as smartphones, appliances, and automobiles.

2. How do microcontrollers transfer data?

Microcontrollers transfer data through a variety of methods, depending on the specific application. Some common methods include serial communication protocols such as UART, SPI, and I2C, as well as wireless communication protocols such as Bluetooth or WiFi.

3. What are the advantages of using microcontrollers for data transfer?

Microcontrollers offer several advantages for data transfer, including small size, low power consumption, and low cost. They are also highly customizable and can be programmed for specific tasks, making them ideal for a wide range of applications.

4. What are some common uses for microcontrollers in data transfer?

Microcontrollers are commonly used in data transfer applications such as sensor networks, home automation systems, and industrial control systems. They are also used in consumer electronics, medical devices, and automotive systems.

5. What should I consider when choosing a microcontroller for data transfer?

When choosing a microcontroller for data transfer, you should consider factors such as the required data transfer speed, the type of communication protocol needed, and the amount of memory and processing power required for your application. You should also consider the cost and availability of the microcontroller, as well as its compatibility with other components in your system.

Similar threads

  • Electrical Engineering
Replies
10
Views
2K
Replies
3
Views
4K
  • Computing and Technology
Replies
3
Views
1K
  • Electrical Engineering
Replies
19
Views
2K
  • Electrical Engineering
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
812
  • Electrical Engineering
Replies
26
Views
3K
Replies
7
Views
2K
  • Programming and Computer Science
Replies
6
Views
3K
  • Electrical Engineering
Replies
7
Views
2K
Back
Top