CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Lcd 240x128 help

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Userrr



Joined: 09 Jul 2004
Posts: 40
Location: Europe

View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger

Lcd 240x128 help
PostPosted: Sat Nov 20, 2004 8:26 am     Reply with quote

I have an LCD with this documentation
http://orangetide.com/computing/gumstix/documentation/lcd/lm24010.pdf

And write source for sample as draw half of screen - white;
half - black

S:
//************************************
#include <18F4320.h>
#device adc=8
#use delay(clock=40000000)
#fuses NOWDT,WDT128,H4, NOFCMEN, NOBROWNOUT, BORV42, PUT, NOCPD, NOSTVREN, NODEBUG, NOLVP, NOWRT, NOWRTD, NOIESO, NOEBTR, NOEBTRB, NOMCLR, NOPROTECT, NOCPB, NOWRTB, NOWRTC, NOPBADEN

#use fast_io(D)


struct port_d_layout
{ short S; // Scan Sturtup Signal
short CP1; // Input Data Latch Signal
short CP2; // Input Data Clock Signal
short D1; // Data D1
short D2;
short D3;
short D4;
short none; // empty
} portdlcd;

#byte portdlcd=0xf83


void main()
{
int i,n;
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF|ADC_TAD_MUL_0);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
set_tris_d(0x00);


while(1) // Зацикливаемся
{

// portdlcd.S=1; // Don't know what is S

for(n=0;n<128;n++)
{
portdlcd.cp1=1; //Begin for one Line
portdlcd.cp1=0;
for(i=0;i<30;i++) // 30x4=240 dots per 1 line
{
portdlcd.cp2=1; //clock high
portdlcd.cp2=0; //clock low
portdlcd.D1=0;
portdlcd.D2=0;
portdlcd.D3=0;
portdlcd.D4=0;
}
for(i=0;i<30;i++) // 30x4=240 dots per 1 line
{
portdlcd.cp2=1; //clock high
portdlcd.cp2=0; //clock low
portdlcd.D1=1;
portdlcd.D2=1;
portdlcd.D3=1;
portdlcd.D4=1;
}
}

portdlcd.S=0;

} // while


} // main


//*******************************************************

That what I get:
http://www.icd2.front.ru/scanlcd.jpg (sory for quality)

PLEASE Help understand how USE S (PIN1) signal (Input or Output)
How Put Pixel at coord(10,10) .
Thanks
Konrad



Joined: 15 Sep 2003
Posts: 34

View user's profile Send private message

PostPosted: Sat Nov 20, 2004 9:07 am     Reply with quote

S is the horizotal sync pulse, from the data sheet hold it high while writing the first row.
Userrr



Joined: 09 Jul 2004
Posts: 40
Location: Europe

View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger

Thanks
PostPosted: Sat Nov 20, 2004 9:37 am     Reply with quote

Thanks Konrad , maybe you help with function to write pixel with
coordinates?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group