Page 1 of 1

gLCD EBM001 in mode SPI

Posted: Sat Aug 22, 2015 4:30 pm
by cubitus54
Hello,

Is it possible to change the type of screen EBM001 SPI hardware?

On the version of Flowcode V5 FC5_xxx_gLCD_.c in the SPI output software.
On the V6 version of Flowcode, the function is compressed and unchangeable ...

Thank you

V5 FC5_xxx_gLCD_.c

Code: Select all

void gLCD_SendByte (char Command, unsigned int Lcdout)
{
/*Macro_gLCD_SendByte_Start*/

	char i, data;
	//unsigned int mask = 0x8000;

	FC_CAL_Bit_Low (%a_MX_GFXLCD_PORT_CS, %a_MX_GFXLCD_PIN_CS);				//MX_GFXLCD_CS 0 start of sequence

	if (Command == MX_GFXLCD_CMD)
	{
		FC_CAL_Bit_Low (%a_MX_GFXLCD_PORT_RS, %a_MX_GFXLCD_PIN_RS);			//0 = MX_GFXLCD_CMD
	}
	else
	{
		FC_CAL_Bit_High (%a_MX_GFXLCD_PORT_RS, %a_MX_GFXLCD_PIN_RS);		//1 = MX_GFXLCD_PARAMeter
	}

	data = Lcdout;

	for (i=0;i<8;i++)
	{
		FC_CAL_Bit_Low (%a_MX_GFXLCD_PORT_CL, %a_MX_GFXLCD_PIN_CL);			//Clock 0
		if (data & 0x80)
			FC_CAL_Bit_High (%a_MX_GFXLCD_PORT_SD, %a_MX_GFXLCD_PIN_SD);    //Output MSB
		else
			FC_CAL_Bit_Low (%a_MX_GFXLCD_PORT_SD, %a_MX_GFXLCD_PIN_SD);

		FC_CAL_Bit_High (%a_MX_GFXLCD_PORT_CL, %a_MX_GFXLCD_PIN_CL);		//Clock 1
		data = data << 1;                       							//Shift Data to left
	}
	FC_CAL_Bit_High (%a_MX_GFXLCD_PORT_CS, %a_MX_GFXLCD_PIN_CS);			//End of sequence

/*Macro_gLCD_SendByte_End*/

Re: gLCD EBM001 in mode SPI

Posted: Mon Aug 24, 2015 11:19 am
by Benj
Hello Cubitus,

Here is the component source for the EBM001 in FC6.
glcd_EBM001.fcfx
(80.45 KiB) Downloaded 374 times
Let me know how your getting on.

Re: gLCD EBM001 in mode SPI

Posted: Mon Aug 24, 2015 4:39 pm
by cubitus54
Hi,

Thank you very much ;)

Re: gLCD EBM001 in mode SPI

Posted: Mon Aug 24, 2015 7:01 pm
by cubitus54
Hello,

Is it possible to create an integrated component in Flowcode?
glcd_EBM001_spi.fcfx
(82.81 KiB) Downloaded 455 times
Timing
SPI Hardware : 0,5µs/div
chrono.gif
chrono.gif (18.06 KiB) Viewed 8455 times

Re: gLCD EBM001 in mode SPI

Posted: Tue Aug 25, 2015 5:30 pm
by Benj
Hello,

Yes you simply use the file -> Export menu and then move the created file into your Flowcode 6/components directory.

Do you want the new component including in the official build?

Re: gLCD EBM001 in mode SPI

Posted: Tue Aug 25, 2015 7:19 pm
by cubitus54
Hello,

Excellent ! :D :D

Code: Select all

Do you want the new component including in the official build?

Why not :)

I may be a few other programs propose to you...

Re: gLCD EBM001 in mode SPI

Posted: Wed Aug 26, 2015 8:33 am
by cubitus54
Hello,

I'd like to try to transform EBM016_Humidity.fcpx in DHT11, DHT22.
Can you give me the component source

Thank you

Re: gLCD EBM001 in mode SPI

Posted: Wed Aug 26, 2015 10:17 am
by Benj
Hello,

Ok I will add your modified component to the build. Can you tell me if there is a specific driver IC or display that works with your modified component so I can add the correct info to the tooltip help.

Here is the EBM016 component source.
EBM016v1.fcfx
(28.18 KiB) Downloaded 380 times

Re: gLCD EBM001 in mode SPI

Posted: Wed Aug 26, 2015 10:50 am
by cubitus54
Hello,


Thank you for the humidity sensor.
The display is 1.8 or SPI. there is not really a reference and there are many version for this inexpensive and popular display.

aff_1.8 spi.jpg
aff_1.8 spi.jpg (122.08 KiB) Viewed 8405 times

Re: gLCD EBM001 in mode SPI

Posted: Thu Aug 27, 2015 9:58 am
by cubitus54
Hello,

More faster :)
Clear all screen in 215 ms -> 160 ms
if one uses an element in the SPI bus.
You can put the CS line to 0 and 0 to let it saves time and makes the fastest display.

Re: gLCD EBM001 in mode SPI

Posted: Thu Aug 27, 2015 10:16 am
by cubitus54
Hello,

More more faster :):)

Only for Ardiuno Mega
I use er SPI register directly (SPDR) in a command C..

90ms for clear all screen :D :D
SPI_c.gif
SPI_c.gif (29.77 KiB) Viewed 8373 times