serial communication with labview using pic16f877a

Discussion on projects that are created by users and posted on mikroElektronika website.
Post Reply
Author
Message
ayush
Posts: 1
Joined: 16 Jan 2011 13:06

serial communication with labview using pic16f877a

#1 Post by ayush » 16 Jan 2011 15:26

My project is to connect labview and pic 16f877a using serial communication and simulate that on proteus. Using virtual serial port software i connected proteus and labview. I am receiving data from labview but not able to print the data on LCD .I also send the data on portD and connected LED's to it and LED's are turned on but i am not getting a meaningful combination so plz can someone tell me what is wrong with the code.
This is my c code :
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D4 at RB0_bit;

// Pin direction
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D7_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB0_bit;



void main()
{
unsigned char output;



UART1_Init(2400);
Lcd_Init();
TRISB=0;
TRISD=0;
PORTD=0;
PORTB=0;


while(1)
{



if (UART1_Data_Ready() == 1) { // if data is received
output=UART1_Read(); //

PORTD=output;
Delay_ms(100 );


Lcd_Out_Cp(output);
Delay_ms(100);



}
}
}

KaranSoin
Posts: 130
Joined: 07 May 2010 22:27
Location: Melbourne, Australia

Re: serial communication with labview using pic16f877a

#2 Post by KaranSoin » 27 Jan 2011 04:42

What is the 100 ms delays after PORTD... and Lcd_o.... for ? If these are not part of any temporary test then these will certainly cause problems.

Reagards

Stismaseretry
Posts: 4
Joined: 07 Jun 2011 16:57
Location: United Kingdom
Contact:

serial communication with labview using pic16f877a

#3 Post by Stismaseretry » 17 Jun 2011 09:07

Are this software compatible with windows vista?

Muphy
Posts: 318
Joined: 24 Feb 2008 14:05
Location: Stonehaven Scotland

Re: serial communication with labview using pic16f877a

#4 Post by Muphy » 17 Jun 2011 13:27

I would suggest that the first thing that you do is hookup labview to a serial console of some sort and see what data is actually being sent that is of course assuming that you have some real hardware.

Once you know the data stream that labview is sending, you can see whether the ascii values are high enough for those characters to be displayed on the LCD, if they are not then you will need to do some conversion on the values to convert them to strings so that they can be displayed on the LCD.

I'm gonna guess that because you are using Proteus you have little or no real hardware and I'm also gonna guess that this is a school project in which case I'm sure your teacher/lecturer would like to see that you figured this out for yourself.

If you want to post some example data that is coming from labview then perhaps we could help a wee bit more.


M

Post Reply

Return to “User Projects”