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.

PIC16F877A interfacing with Serial Port

Status
Not open for further replies.

jasbertfalutine

New Member
I'm trying to interface an ammeter measuring in nano and micro scales with the computer.
I was thinking whether it is possible to use the PIC16F877A microcontroller to interact with the computer.
The project is meant to use the computer to display the readings and change to scale of measurement of the ammeter.
Any resourceful contribution is deeply appreciated.
Thanks
 
Use a systematic approach. what are the big pieces? serial I/O to PC, PIC to PC protocol, data acquisition, control module? There maybe others, I don't know your project at all. draw a block diagram. Then take each block and try to detail it out. Maybe make sub-blocks. Think about how data will flow. At this point you should be getting a sense of the areas that you need to learn about.

I can pretty much see that serial I/O is one of them - there are lots of resources out there that will help you get up to speed on the UART in the 877.

You should also spend some time detailing out the type of information that will be passed between the PIC and the PC (AKA Protocol). try to understand how data wil flow. command from PC to PIC, for example.

edit: oh yeah, have you figured out what you are going to program in? C? ASM? BASIC? you might want to put some thought into that early.
 
Last edited:
From the OP's description, I think he maybe using a meter with RS232 communication. If this is the case then he just needs a serial cable and hyper terminal to figure out what to send and what to expect in return, and then write some code in VB or VC++ etc.

Mike.
 
Why would there be both a PIC 16F877 and a PC involved? If the meter talks RS-232 then the manufacturer probably already has PC software for it. The one I bought certainly does.

If you alrady have the ammeter then the ADC on the PIC won't be too useful. This problem is ill stated and ill defined.
 
Yes, *IF* the meter talks RS232. It could be that he needs the PIC to do the communication, which is what I assumed.

And he might want the ADC because he doesn't know how else he can get the measurement. I know my RS meter reads the segments on the LCD and sends that.

Mike
 
Correct me if I'm wrong. The PIC 16F877A has EXACTLY one USART. It can be connected to the meter, or it can be connected to the PC but not both. If the USART is connected to the meter, then how does the 16F877A talk to the PC. If the 16F877A is connected to the PC how does it talk to the meter.

If the plan is to use the onboard ADC what is the purpose of the meter?

I consider the original post to be an ill defined request, which is impossible to help the poster with until he can clarify what he has in mind. There is just no point in our trying to guess what he intended.
 
Papabravo said:
Correct me if I'm wrong. The PIC 16F877A has EXACTLY one USART. It can be connected to the meter, or it can be connected to the PC but not both. If the USART is connected to the meter, then how does the 16F877A talk to the PC. If the 16F877A is connected to the PC how does it talk to the meter.

Yes, only one USART, but it's trivial to crate another in software - personally I'd use the hardware one for receive, and the software one for transmit.

Don't assume you need a hardware USART, there are probably as many examples of software ones over the years as there are hardware ones!. For example, even the VIC20 used a software UART.
 
Answer to your problem

jasbertfalutine said:
I'm trying to interface an ammeter measuring in nano and micro scales with the computer.
I was thinking whether it is possible to use the PIC16F877A microcontroller to interact with the computer.
The project is meant to use the computer to display the readings and change to scale of measurement of the ammeter.
Any resourceful contribution is deeply appreciated.
Thanks

I propose you following steps
1. Use Current to Voltage converter IC for convert ammeter reading to a voltage value that can interface to PIC's A/D converter chanel.

2. You can use PIC's Asynchronous transmition mode to send data from your PIC to Computer. Here you can use RS232 serial port interface to connect to the PC.

3. the programming of on the computer, can be done by using C# on vislual studio 2005 or just using C language( you need turboC or any IDE with a C compiler)


reffer PIC datasheet for Asynchronous mode programming.

If you need futher information pls free to contact me through email
sureshd_eng@yahoo.com
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top