Microcontroller Data Transfer

  • Thread starter El Moriana
  • Start date
  • #1
33
0

Main Question or Discussion Point

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.
 

Answers and Replies

  • #2
vk6kro
Science Advisor
4,081
40
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 Threads on Microcontroller Data Transfer

  • Last Post
Replies
3
Views
928
  • Last Post
Replies
2
Views
2K
  • Last Post
2
Replies
30
Views
3K
Replies
11
Views
7K
Replies
2
Views
1K
Replies
2
Views
5K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
19
Views
5K
  • Last Post
Replies
2
Views
373
Top