|
|
View previous topic :: View next topic |
Author |
Message |
Franchu Guest
|
Lascar SP 5-GFX1 Graphics Display |
Posted: Thu Oct 04, 2007 9:45 am |
|
|
Hello.
I have two SP 5-GFX1 from Lascar
The display has a serial interface (SCL, SI and CS).
I have read the manual but the display don't turn on.
There'are some examples but they are for Hi-Tech C compiler. I've tryed to convert it to CCs but it doesn't work.
Please, Does anybody a example for this display?.
I have used a 18f4550 at 20MHz.
Thank you. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 04, 2007 5:39 pm |
|
|
You should provide a link to those routines. I did a Google search
and I think this is the sample Hitech code:
http://www.geocities.com/g13685/SP5_GFX1_image.zip
You need to translate these functions to CCS:
Code: | gfx1_ser_output()
gfx1_write_command()
gfx1_write_data()
gfx1_start_up()
|
On every line that sets a pin high, such as this:
Change it to use the output_high() function, like this:
Code: | output_high(gfx1_SI); |
For lines that set a pin low, such as this:
Change it to use the output_low() function, like this:
Code: | output_low(gfx1_A0P); |
On some lines, they set the TRIS like this:
Quote: | gfx1_Reset_direction = output;
gfx1_A0P_direction = output;
gfx1_SI_direction = output;
gfx1_SCL_direction = output; |
You don't need those lines. Just comment them out. In "standard i/o"
mode, the CCS compiler will automatically set the correct TRIS, when
you use the output_low() and output_high() functions. Standard i/o mode
is the default mode of the compiler. You don't have to specifiy it.
It's normally in effect, unless you specify a different mode. |
|
|
flguille
Joined: 04 Oct 2007 Posts: 1
|
|
Posted: Fri Oct 05, 2007 12:05 pm |
|
|
Thank you.
i've tried to convert the code for CCS compiler, but it doesn't work.
I think that i have a problem with the time betwen instrucction. I have saw the PDF of the Display and I insert a delay betwen the change of the SCL signal:
void gfx1_ser_output( unsigned char x )
{
signed char i;
for(i=7; i>=0; i--)
{
if ((x>>i)&0x01)
{
output_high(gfx1_SI);
}
else
{
output_low(gfx1_SI);
}
delay_us(1);
output_low(gfx1_SCL);
delay_us(1);
output_high(gfx1_SCL);
}
}
But I have not idea. This solution doesn't work.
Thank you again.
PCM programmer wrote: | You should provide a link to those routines. I did a Google search
and I think this is the sample Hitech code:
http://www.geocities.com/g13685/SP5_GFX1_image.zip
You need to translate these functions to CCS:
Code: | gfx1_ser_output()
gfx1_write_command()
gfx1_write_data()
gfx1_start_up()
|
On every line that sets a pin high, such as this:
Change it to use the output_high() function, like this:
Code: | output_high(gfx1_SI); |
For lines that set a pin low, such as this:
Change it to use the output_low() function, like this:
Code: | output_low(gfx1_A0P); |
On some lines, they set the TRIS like this:
Quote: | gfx1_Reset_direction = output;
gfx1_A0P_direction = output;
gfx1_SI_direction = output;
gfx1_SCL_direction = output; |
You don't need those lines. Just comment them out. In "standard i/o"
mode, the CCS compiler will automatically set the correct TRIS, when
you use the output_low() and output_high() functions. Standard i/o mode
is the default mode of the compiler. You don't have to specifiy it.
It's normally in effect, unless you specify a different mode. |
|
|
|
|
|
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
|