Connecting a 6800 bus LCD display to Netburner

Discussion to talk about hardware related topics only.
Post Reply
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Connecting a 6800 bus LCD display to Netburner

Post by v8dave »

Hi all,

I have an LCD that has a 6800 bus and the only issue I have is figuring out where I can generate the E (Enable) input to the LCD display. The MOD5234 does not have an E output and looking at the datasheet for the LCD (http://www.crystalfontz.com/products/32 ... 40FTTS.pdf) it is required to clock the data into the LCD.

Looking at the timing, I have a feeling that an inverted version of the chip select may serve as the E clock but I can't confirm this as yet. Just ordered my dev kit and have an LCD so will do some testing when it arrives.

Anyone else connected an LCD to the Netburner modules before? The Hitach controller based text modules also have this E input but I can't find any reference to them being used with Netburner.

Cheers,
Dave...
User avatar
Chris Ruff
Posts: 222
Joined: Thu Apr 24, 2008 4:09 pm
Location: topsail island, nc
Contact:

Re: Connecting a 6800 bus LCD display to Netburner

Post by Chris Ruff »

I have connected graphics LCD modules to NB a couple different times. E looks like it is involved in writing data into the LCD, but it is actually just a clock. I have driven E with the clock divided down and gated with chip select (NB), I have driven it open loop with software and driven it with a hardware timer pin with other processors.

If you give it a slow enough clock you can see the scan line click line-by-line down the display.



Chris
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
seulater
Posts: 445
Joined: Fri Apr 25, 2008 5:26 am

Re: Connecting a 6800 bus LCD display to Netburner

Post by seulater »

I have connected a crystalfontz graphical style lcd to my MOD5234. I did it was this way.


#define CS3_ADDRESS (0x80000000)
#define LCD_CS1_HIGH sim.gpio.ppdsdr_etpu = 0x01;
#define LCD_CS1_LOW sim.gpio.pclrr_etpu =~0x01;
#define LCD_CS2_HIGH sim.gpio.ppdsdr_etpu = 0x02;
#define LCD_CS2_LOW sim.gpio.pclrr_etpu =~0x02;
#define LCD_DI_HIGH sim.gpio.ppdsdr_timer = 0x02;
#define LCD_DI_LOW sim.gpio.pclrr_timer =~0x02;
#define LCD_E_HIGH sim.gpio.ppdsdr_timer = 0x01; E_Pulse_Delay();
#define LCD_E_LOW sim.gpio.pclrr_timer = ~0x01; E_Pulse_Delay();
#define LCD_TOGGLE_E LCD_E_HIGH; LCD_E_LOW;
#define LCD_DATA(x) *( (unsigned char *)CS3_ADDRESS) = x; LCD_TOGGLE_E;


/****************************************************************
Name: LCD_Initialize(void)
Copyright: Free to use at will & at own risk.
Author: JCP
Date: 20/03/05 09:52
Description: Initialize the LCD
*****************************************************************/
void LCD_Initialize(void)
{
LCD_CS1_LOW;
LCD_CS2_LOW;
LCD_E_HIGH;
LCD_DI_LOW;

LCD_DATA(0x3f); // Turn Display on

LCD_DATA(0xc0); // Start Line at TOP of screen

LCD_CS1_HIGH;
LCD_CS2_HIGH;

LCD_Cls();
}
/*****************************************************************
Name: E_Pulse_Delay(void)
Copyright: Free to use at will & at own risk.
Author: JCP
Date: 20/03/05 09:52
Description: Delay time for the E line on the LCD
******************************************************************/
void E_Pulse_Delay(void)
{
VBYTE x; // This must be a Volatile variable

for(x=0;x<60;x++); // 30 is the minimum and not recommended
}
Attachments
MOD5234_to_LCD.pdf
skiz for the code above.
(17.05 KiB) Downloaded 336 times
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: Connecting a 6800 bus LCD display to Netburner

Post by v8dave »

Thanks for both solutions. The first one sounds the best for my application as I want to map the LCD into the memory map and simply access it directly without doing any GPIO etc. This would ensure that it works at the fastest speed.

I am not keen to use things like for loops to create delays. They are rather dependant on processor speed and take up to much time. Better to use a timer and yield to other tasks if you need to do this sort of thing.

I'll have a look at the timing again. Once I get my dev kit I can try out a few things as I have an LCD ready and waiting to test this with.

Thanks again.
Dave...
seulater
Posts: 445
Joined: Fri Apr 25, 2008 5:26 am

Re: Connecting a 6800 bus LCD display to Netburner

Post by seulater »

I am not keen to use things like for loops to create delays. They are rather dependant on processor speed and take up to much time. Better to use a timer and yield to other tasks if you need to do this sort of thing.
i agree, Chris's idea is an excellent way to do it as well. The delay here is so short, that i just didnt feel the need to go the extra mile for it ;)
Post Reply