PIC16F877A+UART for LABVIEW

Thread Starter

navidbox

Joined Mar 6, 2009
11
Dear all,

please kindly help me with this.

I need to send four measurement parameters to the PC for display and storage purposes. The software for this aim is LABVIEW. I am new to PIC and Interfacing, but by putting so much effort and asking questions from experts, i could have accomplished the acquisition of all the data till today. ( PIC16F877A, C language with Hi-tech compiler and using PROTEUS as simulator)
I could also transmit a character "HELLO" through RS232 with my UART to USB converter and the result in hyperterminal was observed as well.
I am quite happy that i could have reached up to this stage. but on the other hand, unfortunately my knowledge is absolutely poor about LABVIEW.
I have heard that if i have control over the format of the data from PIC to LABVIEW, it is not that difficult.
Please find the attached pictures of the design for better understanding.

Questions:
1- can you please explain what is the technique to transmit the 10-bit data from PIC ADC to the 8-bit serial port? something like this:

do {
for (i=0; i <=7; i++) {
myarray=read_temp();
}

for (i=0; i <=7; i++) {
putch (Lo(myarray)); //send the lower 8 bits of ADC reading
putch(Hi(myarray)); // Send upper 8 bits of ADC reading
}

2- How to identify each channel at the reception side (LABVIEW). For example, 1011011110=Channel 0 (ADC-1=Light) or 1011010110=Channel 1 (ADC-1=temperature) and so on. Something like this can work?

do {
an0 = ADC_Read(0) >> 2;
USART_Write(an0);
an1 = ADC_Read(1) >> 2;
USART_Write(an1);

an2 = ADC_Read(2) >> 2;
USART_Write(an2);

an3 = ADC_Read(3) >> 2;
USART_Write(an3);

an4 = ADC_Read(4) >> 2;
USART_Write(an4);

Thanks in advance for your help.
 

Attachments

t06afre

Joined May 11, 2009
5,934
Double posting please continue HERE And also describe what you have done so far. And why and how you struggle. Good question draw good answers. Do you have any Labview code post that also.
 

GetDeviceInfo

Joined Jun 7, 2009
2,196
I could also transmit a character "HELLO" through RS232 with my UART to USB converter and the result in hyperterminal was observed as well.
I am quite happy that i could have reached up to this stage. but on the other hand, unfortunately my knowledge is absolutely poor about LABVIEW
with this accomplished, you should be able to read your chars into Labview to confirm connection.
 
Top