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.

How to write a simple "Hello World" code with CCS compiler

Status
Not open for further replies.

debutpic

Member level 4
Member level 4
Joined
Aug 13, 2001
Messages
76
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
475
Hi all
Until today,i programmed with PBP (melabs),but now i want to learn the C language,my choice is CCS compiler.
For my first progam i want to use a LCD for to show "HELLO WORLD",but no instruction is equal at (lcdout melabs),how to make?
Can you send me a little program
I use a board and the next connections
RB7->DB7
RB6->DB6
RB5->DB5
RB4->DB4
RB3->RS
RB2->E

thank's in advance
 

H_u_n_t_e_r

Full Member level 2
Full Member level 2
Joined
Nov 24, 2001
Messages
149
Helped
6
Reputation
12
Reaction score
2
Trophy points
1,298
Activity points
1,053
lcd.c ccs

printf(LCD_PUTC, "hello world");
thats it.
also please check c:\program files\picc\examples directory
(ex_admm.c , ex_lcdkb.c)
there are lcd applications. in these files.

according to lcd.c(this file is driver for lcd) c:\program files\picc\drivers

// As defined in the following structure the pin connection is as follows:
// D0 enable
// D1 rs
// D2 rw
// D4 D4
// D5 D5
// D6 D6
// D7 D7
//
// LCD pins D0-D3 are not used and PIC D3 is not used.

U can use PortB or PortD as lcd port by define in lcd.c file
Regards.
 

debutpic

Member level 4
Member level 4
Joined
Aug 13, 2001
Messages
76
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
475
ccs lcd c

thank's for your reply
please can you send me the file lcd.c modified for to compare him with the original file

another question
i can't use a LCD without the driver lcd.c,because to show this little"HELLO WORLD" must take much flash memory no?
 

ME

Advanced Member level 4
Advanced Member level 4
Joined
Mar 14, 2002
Messages
1,309
Helped
55
Reputation
112
Reaction score
40
Trophy points
1,328
Activity points
14,859
ccs lcd

I have uploaded a modified LCD.C for CCS in this topic:
Maybe you can learn from it and modify it for your own purpose.
 

Analyzer

Full Member level 6
Full Member level 6
Joined
Nov 18, 2001
Messages
374
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
3,518
ccs lcd.h

Hi,

You should include necessary header files to code.For example is you use lcd, you should include instant lcd header like #include <lcd.h> If you bother optimized code, i heard hi-tech produces more optimized and short code vs ccs.I didn't try it but heard. Good luck ;)

Analyzer.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top