• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sending Data to PC using PIC18F4550 through USB

Status
Not open for further replies.

aforadi

New Member
Right so my first post...What I am doing in my project is as follows:
1. I am using the LM35 temperature sensor and converting the analog output into digital using PIC's A/D
2. Then I want to send this output to the PC

Now here are my series of doubts after making lots of efforts on the internet and google.
1. How do I transfer the bits of the digital output which is produced by the A/D and stored in the ADRESH and ADDRESL registers?
2. Will it come out of a port serially?(Do I have to code it that way?)
3.How do I get the readings on the PC side in Hyper Terminal?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
If you care to read my PIC tutorials (based on the 16F series) they show how to read the analogue inputs and transfer the data to a PC via serial and Hyperterminal.
 

Russ Hensel

New Member
break the project into subsections and get each working one at a time.
for example *test the temp sensor with a multimeter.
*get the serial comm working by its self.....
 

aforadi

New Member
Will these be valid for USB also?The problem is that I don't want to use RS 232 mode...I have installed a USB connector on the PCB and am using that to connect to the PC
 
Last edited:

aforadi

New Member
break the project into subsections and get each working one at a time.
for example *test the temp sensor with a multimeter.
*get the serial comm working by its self.....
I have done the temp. sensor part...The problem is coming is the serial communication part via USB
 

Nigel Goodwin

Super Moderator
Most Helpful Member
There are various USB examples in the MicroChip application notes, plus various ones on the net - however, the USB side is going to be many times more complicated than the rest of the project added together.
 

aforadi

New Member
I am not too sure...Because I tried implementing their CDC files on my PIC and that gave me an output on the terminal window...I am just finding it hard to figure out what they they did to produce that text on HyperTerminal
 

Nigel Goodwin

Super Moderator
Most Helpful Member
It's just as simple using the 18F4550, it's only the USB part which is complicated - you might try the 'USB bit whacker' which is a good starting point for USB.
 

Someone Electro

New Member
Yes microchip gives you something called a USB framework, Its a big pile of C code librarys, some of it takes care of transfering the bits over USB and responding to the PC corectly. That pice of code you dont realy need to understand.

Then there is the code that makes the USB acualy do something useful like for exsample the CDC driver that makes a com port and the file that contains the USB identifier. The idenditifer file is a pile of strings that the PIC sends to the PC when its pluged in. They tell the PC everythyng about that device from the manufacruter to its name and to what it is and what the device can do.

You can look trough the CDC exsamples main to see what its doing, that file also has a pile of callback subrutines that get called by the USB library on certan events like standby or initalization complete and such.

One thing to watch out is that you need to call a rutine to service USB reqests from the PC every few ms or the USB device becomes unresponsive.
 

superbrew

Member
I think that the easiest way is what Nigel had suggested: UBW
This will show up as COM port on the PC, so interfacing should be pretty easy.
 

aforadi

New Member
Thnks a lot for the info...Having completed this I now want to run this using bluetooth...So is it as simple as replacing the usb cable with usb bluetooth?
 

Someone Electro

New Member
Well your in luck if you did CDC USB, Because by coincidence bluetooth also acts as a ordinary COM port. But there is no USB over bluetooth thingy.
 

aforadi

New Member
So I cant use it right?
Ok...Then
Can anyone suggest me a tutorial for RS232 communication with PC for 18F4500?
 

LOUCHENE

New Member
Hi,

there even me i need to do the intercaing of Bluetooth module "ericsson ROK module" with USB through PIC18F4550 any one help me

Thanks so much
 

LOUCHENE

New Member
thanks Mr, i have ROK101 008 "ericsson module" (the output is UART )+PIC18F4550 ("the output is USB,

how can the data transmit from UART to USB ?Firmware??

thanks
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top