Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

P16f877a interface to PC via USB by Mikroc code

Status
Not open for further replies.

dahroug

Member level 2
Joined
Mar 20, 2010
Messages
48
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,541
i want to build a spirometer (Biomedical) and it based on flow sensor i am using 16f877a for ADC and i want to interface to PC to show Flow/time curve and i will use matlab's GUI.
But: How Could i Make this interface??
what is the code in mikroc and what is the main component?
plz hepl
 

The code as you have mentioned will be in mikroc, please read microc user guide

---------- Post added at 09:33 ---------- Previous post was at 09:32 ----------

main component:

pic16f877a
oscillator
flow sensor
power supply
matlab
mikroc compiler

---------- Post added at 09:36 ---------- Previous post was at 09:33 ----------

From here i can see that you have to use serial interface to PC, if you use 18F, you will have the alternative of USB interface, which will be much faster. The code in the microcontroller will just do the conversion and throw them to the PC. Most work will be done on GUI to interpret the data

---------- Post added at 09:37 ---------- Previous post was at 09:36 ----------

From here i can see that you have to use serial interface to PC, if you use 18F, you will have the alternative of USB interface, which will be much faster. The code in the microcontroller will just do the conversion and throw them to the PC. Most work will be done on GUI to interpret the data
 
if you want to use 16f877a..u cant directly connect through USB..u need USB to rs232 converter..or you can go to computer hardware shop and find for USB to Serial Port cable..
then study for ADC and UART module that include in 16f877a.. then for computer interface, u can use Microsoft Visual Basic or visual C++.. but i preffer VB..

thelocxresearch.tk
 
I wrote a code for ADC and i will use matlab GUI.
but now what is the name of hardware components for the interface in the market i got the flow sensor and PIC .
 

since its all ready, just use the serial to usb converter but get some medium price. Cheap price serial USB converter is not using FTDI chip :)
 

ok
could u make a simple block diagram for this interface from PIC to PC with the names of recommended component of interface parts cuz it is the first time for me to do such this interface
and thank u so much for ur help
 

now that you needed usb interface, it is time to change over to a better device like 18F4550
it has internal usb support, and needed drivers would be available on microchip site
 



---------- Post added at 15:52 ---------- Previous post was at 15:51 ----------

hahaha ..... yup, mvs sarma. the USB framework!
 

ok
the usb end of the USB-Serial-Converter will connected to PC and the serial end will connected to my hardware
so where can connect the serial in my hardware as shown in my schema???
and what is the Mikroc related code for the interface process .
and thank you so much for your interest.
 

the serial to your hardware is through your serial pin of the PIC, TX and RX

---------- Post added at 10:00 ---------- Previous post was at 09:58 ----------

just look for any serial interface code :) there should be some samples in microc compiler
 
ok..here is how to connect..
 

Attachments

  • serial com.jpg
    serial com.jpg
    174 KB · Views: 149
Thanks a lot i understood these steps .
How Could i display the flow - time curve ??
actually how to make xls file with the values of samples to draw it by matlab?
 

im sory for matlab..huhuhu...
myb someone in this forum can help..
wait for another reply..
:)
 

ok i think it is related mainly to Microcontroller .Matlab just for display values generated by Microcontroller .
My question is how to generate this values in xls file out matlab?
 

You need some GUI to capture the data. Most likely you have to use some macro in the excel
 

Visual Basic can do this..try search on the net..MSCOMM to xls..
 
there are no flow sensors in protous
what should i do?
 

the flow sensor that u use sent the analog signal rite?
if yes..u can use pot-lin as the sensor input..search pot-lin in the component library..
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top