|
|
View previous topic :: View next topic |
Author |
Message |
Userrr
Joined: 09 Jul 2004 Posts: 40 Location: Europe
|
Lcd 240x128 help |
Posted: Sat Nov 20, 2004 8:26 am |
|
|
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
|
|
Posted: Sat Nov 20, 2004 9:07 am |
|
|
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
|
Thanks |
Posted: Sat Nov 20, 2004 9:37 am |
|
|
Thanks Konrad , maybe you help with function to write pixel with
coordinates? |
|
|
|
|
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
|