Libstock
It is currently 23 Oct 2014 21:34

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 16 Jan 2011 15:26 
Offline

Joined: 16 Jan 2011 13:06
Posts: 1
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);



}
}
}


Top
 Profile  
 
PostPosted: 27 Jan 2011 04:42 
Offline

Joined: 07 May 2010 22:27
Posts: 127
Location: Melbourne, Australia
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


Top
 Profile  
 
PostPosted: 17 Jun 2011 09:07 
Offline

Joined: 07 Jun 2011 16:57
Posts: 4
Location: United Kingdom
Are this software compatible with windows vista?


Top
 Profile  
 
PostPosted: 17 Jun 2011 13:27 
Offline

Joined: 24 Feb 2008 14:05
Posts: 318
Location: Stonehaven Scotland
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group