Communication between PIC16F877A and Laptop USB

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Communication between PIC16F877A and Laptop USB

Postby sengyee88 » Tue Mar 22, 2011 12:29 pm

hello..

UC00A.jpg
UC00A


1) As from the figure above, how to connect the UC00A device between PIC16F877A and Laptop USB?
2) does UC00A support Window 7?
3) does it require any extra components or requirement between the communication?
4) is that possible to link the MATLAB software to this UC00A as i need to send/transmit data/picture to graphic LCD through PIC16F877A?


I'm new to this kind of communication.. please advice.
Thank you!
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Re: Communication between PIC16F877A and Laptop USB

Postby ABSF » Wed Mar 23, 2011 7:16 am

I'm new to this kind of communication.. please advice.


So am I :)

1) As from the figure above, how to connect the UC00A device between PIC16F877A and Laptop USB?
2) does UC00A support Window 7?
3) does it require any extra components or requirement between the communication?
4) is that possible to link the MATLAB software to this UC00A as i need to send/transmit data/picture to graphic LCD through PIC16F877A?


1) Plug the USB side to your PC and connect the 3 pins Tx, Rx and Gnd to your PIC. Refer to P6 of the UC00A user manual.
2) Dont know. If you try and you'll know.
3) What extra components do you have in mind? But at least you'll need software on both sides.
4) Never used MATLAB before.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Communication between PIC16F877A and Laptop USB

Postby yonghui » Wed Mar 23, 2011 9:48 am

hi,

if the matlab can communicate with COM PORT then it should be able. the UC00A creating a virtual COM port for the computer, software on computer can detect it.
i think there will be solution for Matlab since so many people using matlab.



regards,
yh
thanks&regards,
yh
yonghui
Professional
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Communication between PIC16F877A and Laptop USB

Postby Brian Griffin » Wed Mar 23, 2011 10:35 am

I don't think a Matlab is needed much since the thread OP needs to load up the image into the microcontroller.

Those GLCD software can convert any bmp into 1-bit thresholded image.

If by using the Matlab, try the image processing toolbox. They have many functions for image conversion too.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Communication between PIC16F877A and Laptop USB

Postby sengyee88 » Wed Mar 23, 2011 2:42 pm

if the matlab can communicate with COM PORT then it should be able. the UC00A creating a virtual COM port for the computer, software on computer can detect it.
i think there will be solution for Matlab since so many people using matlab.


Hi yonghui.. i do know matlab can communicate with COM port. and i did successfully install the software in my laptop.. but i dont know how to use it to communicate as well the programming code in PIC16F877A

I don't think a Matlab is needed much since the thread OP needs to load up the image into the microcontroller.
Those GLCD software can convert any bmp into 1-bit thresholded image.
If by using the Matlab, try the image processing toolbox. They have many functions for image conversion too.


hi brian.. what do u meant by thread OP needs to load up the image intro microcontroller?

p/s: my project now is facing problem in transmitting and receiving the data/image captured by using laptop camera between MATLAB and GLCD through PIC16F877A. Please lead me on it. i'm still blur on this.
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Re: Communication between PIC16F877A and Laptop USB

Postby sich » Wed Mar 23, 2011 10:10 pm

To solve your problem on getting the PC to communicate with PIC through UC00A, you can refer to SK40C PIC Start Up Kit. Since you're using PIC16F877A, you should download PIC16F Sample Source Code at Useful Document section. UART.c in the folder demonstrates bidirectional communication between PC and PIC. For the PC side, you only need any terminal program (eg: Hyperterminal, Realterm...) to send/receive the data.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 604
Joined: Tue Apr 21, 2009 2:15 pm

Re: Communication between PIC16F877A and Laptop USB

Postby sengyee88 » Sun Mar 27, 2011 3:28 am

To solve your problem on getting the PC to communicate with PIC through UC00A, you can refer to SK40C PIC Start Up Kit. Since you're using PIC16F877A, you should download PIC16F Sample Source Code at Useful Document section. UART.c in the folder demonstrates bidirectional communication between PC and PIC. For the PC side, you only need any terminal program (eg: Hyperterminal, Realterm...) to send/receive the data.


I have tried using the sample source code given by cytron yesterday, it only show up the "Cytron Tech. SK40C" on the LCD, but it did not show any result on the hyperterminal side. i had connect the Tx to RC6.... Rx to RC7.... GND to GND... but not VCC since there is a power supply by the adapter to the PIC.

somehow, i did also tried the sample source code of led_ blinking.c... it's worked! so i think hv no problem on the hardware.

What's are the problem causing it? i really have no idea how to troubleshoot.
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Re: Communication between PIC16F877A and Laptop USB

Postby sengyee88 » Sun Mar 27, 2011 4:33 am

Well.. there are few cases i tested..
1) when RX->RC7 and Tx -> RC6... the yellow and red LED on the USB & UART converter is blinking... eg: when i press the button, the Rx (yellow) led will blink... when i press keyboard key, the Tx (red) led will blink... however this is the result =>
Untitled.png


2) When Rx->RC6 and Tx->RC7.... only the yellow is blinking.... eg: when i press button.. the Rx (yellow) led will blink and show output ("SK40C UART TEST PROGRAM")... when i press keyboard key, it has no response... however this is the result =>
Untitled1.png


Please help
i have no ideal what's wrong with that...

TQTQ!
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Re: Communication between PIC16F877A and Laptop USB

Postby robosang » Sun Mar 27, 2011 6:46 pm

I have been using UC00A and SK40C for sometime, no problem. Don know what is the difficulty you are having. Your 2nd connection is correct. Rx of UC00A should be connected to RC6 is Tx pin for PIC, and Tx to RC7. When you press keyboard, there is no response? What is the "iioooo............." character at the last line? Those characters are echo from PIC. If you unplug the SK40C from UC00A connection and press key on keyboard, those characters will not appear. HyperTerminal will display character being received from COM port, it will not display character being press on keyboard. Character being press on keyboard will be send out. From what I see, everything is working as expected.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Communication between PIC16F877A and Laptop USB

Postby sengyee88 » Sun Mar 27, 2011 9:30 pm

Your 2nd connection is correct. Rx of UC00A should be connected to RC6 is Tx pin for PIC, and Tx to RC7.


according to the datasheet, RC6 pin of PIC is referred as Tx and RC7 as Rx... why they connect inversely?

If you unplug the SK40C from UC00A connection and press key on keyboard, those characters will not appear. HyperTerminal will display character being received from COM port, it will not display character being press on keyboard. Character being press on keyboard will be send out. From what I see, everything is working as expected.


from the sample source code, it supposed able to send the "========SK40C UART TEST PROGRAM=======" to Hyperterminal whereas to control the LED1 and LED2, it has to press key 'O' and 'N' send to signal to PIC to switch on the LED1 and LED2 respectively right?

Rgds
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 2 guests

cron