Continue to Site

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.

  • 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.

Recommendations for learning how to transmit/receive data between PIC and PC/laptop?

Status
Not open for further replies.

blah2222

Member
Hello all,

I have been tinkering around with microcontrollers for the past while this summer and have gotten fairly comfortable with how they work in a local system, but for some of my projects I would like to be able to monitor or control data from my laptop.

For instance, say I have an analog signal, I then convert it to a digital value with an onboard PIC ADC, and I would like to send this to my laptop to be read by a program in real-time.

I have a fair grasp on PIC architecture and coding in C18, but I don't really know how to get started with this task. I am familiar with PIC18's and C18 and I am wondering if there are any good tutorials or development boards that I can look into to get started.

Ideally I would like to use a PIC18 and be able to transmit data through a USB cord to my laptop to be intercepted by MATLAB for plotting.

Any recommendations?

Thanks!
JP
 
My tutorials cover this for the 16 series in assembler, and using RS232.

Hi Nigel,

Thank you for your quick reply! I really admire the work that you have done to put together such a concise tutorial library for those starting out. My one concern for myself is that I don't have access to a serial port for my laptop (MacBook Pro). I am interested to try out Tutorial 7 on RS232, but I don't know how I would interface with my USB port.

Also, you recommend the PIC16F876, I have a PIC16F84A, would that be sufficient?

***EDIT
I should also note that even though I am using a MacBook Pro, I am running Windows XP for MPLAB and PIC usage.

Thanks again!
JP
 
Last edited:
Hi Nigel,

Thank you for your quick reply! I really admire the work that you have done to put together such a concise tutorial library for those starting out. My one concern for myself is that I don't have access to a serial port for my laptop (MacBook Pro). I am interested to try out Tutorial 7 on RS232, but I don't know how I would interface with my USB port.

Use a USB/Serial converter lead, it's by FAR the cheapest and easiest way to get data in your USB port.

Also, you recommend the PIC16F876, I have a PIC16F84A, would that be sufficient?

The 16F84A was basically obselete well before the end of the 20th century, and it also doesn't include analogue inputs, so is useless for your application. If you want 18 pin, something like the 16F88 would do the job, or even better the enhanced 16 series, like the 16F1827 - which I now use (much higher spec, and even cheaper).

***EDIT
I should also note that even though I am using a MacBook Pro, I am running Windows XP for MPLAB and PIC usage.

If you want proper USB, and C18, then you might look at the UBW

https://www.schmalzhaus.com/UBW/
 
Great, I will definitely look into the USB/Serial converter. I think learning assembly would be good as it really explains what is going on inside the PIC.

Another question that may sound silly, but how do you actually send and receive data on/from the PC? Is there some sort of program that I can download to enable and eventually load the data transfers from?

***EDIT

Nvm, RealTerm or HyperTerminal.
 
Last edited:
You can use a 18F4550 which you can use as a USB CDC, effectively giving you UART to USB (TTL Serial, not RS232, which is what you want). This is available in DIP variant, and the smaller footprint 18f2550 variant. As well as some newer "K" series PIC's, free samples available from Microchip. Saves level shifting to 232 also!
 
I've found HyperTerminal to be buggy. I STRONGLY prefer TeraTerm or BrayTerm. Both are free ware.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top