Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 23, 2024, 07:24:35 07:24


Login with username, password and session length


Pages: [1]
Print
Author Topic: LCD and USART problem in CCS  (Read 6539 times)
0 Members and 1 Guest are viewing this topic.
enen
Guest
« on: April 21, 2008, 09:58:03 09:58 »

Hi

i am using Proteus for testing compiled code and i am trying to write code witch ccs but i have problem about LCD and USART.

When i define #RS232 ........... line for using Usart, LCD commands don't work.
When i delete this line LCD commands works ,Usart command don't work.

So include <lcd.c> and #RS232 ...... line don't work in the same code.

How can i solve this problem.

Logged
aliveli
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 2
-Receive: 9


« Reply #1 on: April 22, 2008, 08:03:40 08:03 »

dont trust proteus it doesnt work right all the time
make a simple development board with a breadboard, put everyhing you need on
it and then check your programs on it
Logged
hate
Hero Member
*****
 Warned
Offline Offline

Posts: 555

Thank You
-Given: 156
-Receive: 355


« Reply #2 on: April 22, 2008, 09:05:50 09:05 »

What pins do you define for 'USART', do they interfere with LCD pins?
What PIC do you try to simulate? What's your '#RS232' definition? Proteus can be really slow when simulating lots of things, did you run the simulation enough to see everything works or not? I also advice usage of a real hardware for simulation!

Regards...
Logged

Regards...
goaman1
Guest
« Reply #3 on: April 26, 2008, 02:20:40 14:20 »

which function you are using for writing on lcd?

Logged
neer4evr
Guest
« Reply #4 on: May 01, 2008, 06:18:02 06:18 »

best way to debug ur prob in proteus is to load coff file (generated by ur compiler) in proteus and then do single stepping. Proteus is a nice system simulator and normally the problem is with our design rather than proteus.
Logged
shinesta
Guest
« Reply #5 on: June 08, 2008, 08:20:32 08:20 »

If the pins are conflicting open up lcd.c in your driver folder for picc and read the instructions for using port b instead of port d, which is the default port. It is also possible to use another port but you need to set up the # locate lcd = (the hexadecimal register address of the port you wish to use). For the 18f with ports A-E the addresses are 0x0f80 up to 0x0f84. The next #locate lcd = 6 for port b and 8 for portb. You can check this up in the datasheet but should be 5 up to 9 for ports A-E. Make sure the lcd is connected as defined in the structure in lcd.c. I use proteus and resolved problems with mikroc and ccs c which I had.
« Last Edit: June 08, 2008, 08:33:22 08:33 by shinesta » Logged
PIC_rookie
Newbie
*
Offline Offline

Posts: 9

Thank You
-Given: 23
-Receive: 1


« Reply #6 on: July 17, 2008, 07:05:22 19:05 »

include LCD.h in CCS C use connect LCD 4 pin
Logged


trunghaudt2
Guest
« Reply #7 on: July 23, 2008, 06:13:40 06:13 »

i have a code successful include: LCD and USART

#include <16f877a.h>
#include <def_877a.h>
#use delay(clock=20000000)
#FUSES NOWDT, HS, NOPUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP, NOCPD, NOWRT
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9)

#include <lcd_lib_4bit.c>
//#include <input.c>

int8 count=0;
char string_in[16];

#INT_RDA
Receive_isr() {
char c;
int8 i;
count++;
c = getc();
putc(c);
if (c=='c' | c=='C')
   {
      LCD_putcmd(0x01);    //Clear Screen
      c='c';
      count=0;
   }

if ((count<=16) && (c!='c'))  LCD_putchar(c);
if (count > 16)
   {
      count=0;
      LCD_putcmd(0xC0);
   }
}
void main()
{

enable_interrupts(int_rda);
enable_interrupts(GLOBAL);

lcd_init();
lcd_putcmd(0x01);
lcd_putcmd(line_1);
printf("Enter a String.");
printf("Or anything you want!");
while (1) {}
}
Logged
TomJackson69
Active Member
***
Offline Offline

Posts: 218

Thank You
-Given: 26
-Receive: 63


« Reply #8 on: July 26, 2008, 06:37:07 18:37 »

Hi

i am using Proteus for testing compiled code and i am trying to write code witch ccs but i have problem about LCD and USART.

When i define #RS232 ........... line for using Usart, LCD commands don't work.
When i delete this line LCD commands works ,Usart command don't work.

So include <lcd.c> and #RS232 ...... line don't work in the same code.

How can i solve this problem.



enen,

It is so rude that you post your problem with the hope that other kind members will help you. I see many members that they are kind to help; but you properly don't even read. You don't give thank, you don't response to their post.

I suggest to enen (and other), next time, when you post for help, you should interact so other know your problem solved or not. At leat use the thank botton to show your response.

Tom
Logged

Con Rong Chau Tien
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC