Lcd Code
Re: Lcd Code
Hi Chris,
Is this a mono LCD? Can you give a part no. so we can see the interface for it?
If it is, then the S1D13700 from Epson is a likely controller that you can hook up to the Netburner modules. You can also use the RA8835 from RAiO in Taiwan which is a replacement for the older Epson SED1335 but it requires external RAM, whereas the S1D13700 has this built into the controller.
There is also the older SED1335 from Epson but I would avoid this as it has a nasty hardware bug that causes flicking on the display if you are using fast updates to the LCD. Not sure if the RA8835 has this fixed as not tried it yet.
I found this in one quick search.
http://www.lcdinfo.com/products/usb13700.html
Good luck.
Dave...
Is this a mono LCD? Can you give a part no. so we can see the interface for it?
If it is, then the S1D13700 from Epson is a likely controller that you can hook up to the Netburner modules. You can also use the RA8835 from RAiO in Taiwan which is a replacement for the older Epson SED1335 but it requires external RAM, whereas the S1D13700 has this built into the controller.
There is also the older SED1335 from Epson but I would avoid this as it has a nasty hardware bug that causes flicking on the display if you are using fast updates to the LCD. Not sure if the RA8835 has this fixed as not tried it yet.
I found this in one quick search.
http://www.lcdinfo.com/products/usb13700.html
Good luck.
Dave...
Re: Lcd Code
QY-162A 8 bit parallel, would like to run it in 4 bit, also trying to figure out the pwm, whats the lowest frequency hardware pwm can do on the 5282?
Thanks
Chris
Thanks
Chris
Re: Lcd Code
Hi, you can run this LCD as 4 bit and you can ignore my first posting as I hadn't realised it was a text display.
There is hundreds of drivers out there for these displays. They are easy to hook up to micros so you should be able to get it going quite quickly.
The driver is based around the Hitach HD44780.
Good luck
Dave...
There is hundreds of drivers out there for these displays. They are easy to hook up to micros so you should be able to get it going quite quickly.
The driver is based around the Hitach HD44780.
Good luck
Dave...
Re: Lcd Code
I was looking around, but i am a bit confused on how to set the gpio's
Re: Lcd Code
Ok wired up a lcd
#define lcdRS J1[23]
#define lcdE J1[22]
#define lcdD4 J1[25]
#define lcdD5 J1[24]
#define lcdD6 J1[27]
#define lcdD7 J1[26]
been looking for docs on how to write the data lines, instead of doing it by bits,
for init could send 0x2,0xc0xc,0x1,0x6 instead of setting each pin and sending 0010,1100,0001,0110 etc.....
#define lcdRS J1[23]
#define lcdE J1[22]
#define lcdD4 J1[25]
#define lcdD5 J1[24]
#define lcdD6 J1[27]
#define lcdD7 J1[26]
been looking for docs on how to write the data lines, instead of doing it by bits,
for init could send 0x2,0xc0xc,0x1,0x6 instead of setting each pin and sending 0010,1100,0001,0110 etc.....
Re: Lcd Code
Can anyone give me a hand with this? i've put together some code but having issues.... this is on a mod5282
lcdRS J1[5]
lvdE J1[6]
thanks
Chris
lcdRS J1[5]
lvdE J1[6]
Code: Select all
void lcdSendCmd(char c)
{
int h=c/16;
int l=c%16;
lcdRS = 0;
lcdE = 0;
sim.gpt[1].port = h;
lcdE = 1;
OSTimeDly(1); //450ns min
lcdE = 0;
OSTimeDly(1); //5ms command 200us data
sim.gpt[1].port = l;
OSTimeDly(1); //450ns min
lcdE = 0;
OSTimeDly(1); //5ms command 200us data
}
void lcdSendChar(char c)
{
int h=c/16;
int l=c%16;
lcdRS = 1;
lcdE = 0;
sim.gpt[1].port = h;
lcdE = 1;
OSTimeDly(1); //450ns min
lcdE = 0;
OSTimeDly(1); //5ms command 200us data
sim.gpt[1].port = l;
OSTimeDly(1); //450ns min
lcdE = 0;
OSTimeDly(1); //5ms command 200us data
}
void lcdPutString(char str[])
{
for (unsigned int i=0; i<strlen(str); i++)
{
lcdSendChar(str[i]);
OSTimeDly(2);
}
}
void InitLcd()
{
/*
* lcdRW
* lcdRS
* lcdE
* Data sim.gpt[1]
*/
sim.gpt[1].scr1 = 0; //turn off gpt
OSTimeDly(1);
for(int i=0;i<3;i++)
{
lcdSendCmd(0x03);
}
lcdSendCmd(0x28); //4 bits 2 lines
lcdSendCmd(0x08); //enable & display cursor
lcdSendCmd(0x01); //clear
lcdSendCmd(0x06); //cursor positioning
lcdSendCmd(0x0C); //turn on display
}
thanks
Chris
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: Lcd Code
Looks like your 2nd line has a typo:
lcdRS J1[5]
lvdE J1[6]
Looks like your first two lines may need a typedef:
typedef lcdRS J1[5]
typedef lcdE J1[6]
Looks like there are some issues with the delays:
OSTimeDly(1) will be 1/20th of a sec, or 50mSec.
Not sure what you are upto with these lines:
sim.gpt[1].port = h;
sim.gpt[1].port = l;
There are many other GPT, PIT or DMA timers if you need shorter durations. See:
1) TheStopwatch.h and stopwatch.cpp app posted to this forum:
http://forum.embeddedethernet.com/viewt ... f=7&p=1945 or
2) The PIT appnote on the 5258 page:
http://www.netburner.com/downloads/mod5 ... ppNote.pdf
lcdRS J1[5]
lvdE J1[6]
Looks like your first two lines may need a typedef:
typedef lcdRS J1[5]
typedef lcdE J1[6]
Looks like there are some issues with the delays:
OSTimeDly(1) will be 1/20th of a sec, or 50mSec.
Not sure what you are upto with these lines:
sim.gpt[1].port = h;
sim.gpt[1].port = l;
There are many other GPT, PIT or DMA timers if you need shorter durations. See:
1) TheStopwatch.h and stopwatch.cpp app posted to this forum:
http://forum.embeddedethernet.com/viewt ... f=7&p=1945 or
2) The PIT appnote on the 5258 page:
http://www.netburner.com/downloads/mod5 ... ppNote.pdf
Re: Lcd Code
the first 2 lines are actually defines, i just included them so you could know what pins they are on....
i saw an example somewhere where the guy was just using OSTimeDly(1) seconds
sim.gpt[1].port = h; high part of the byte
sim.gpt[1].port = l; low part of the byte
i saw an example somewhere where the guy was just using OSTimeDly(1) seconds
sim.gpt[1].port = h; high part of the byte
sim.gpt[1].port = l; low part of the byte
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: Lcd Code
Take a look at the descriptions and use of OSTimeDly( n ) in
C:\Nburn\docs\NetworkProgrammersGuide\NNDKProgMan.pdf
C:\Nburn\docs\NetBurnerRuntimeLibrary\uCOSLibrary.pdf
By default, each tick "n" in OSTimeDly() is worth 50mSec. This can be changed by edits to the TICKS_PER_SECOND macro in ucos.h. The default for TICKS_PER_SECOND is 20, ie 1/20th sec = 50 mSec. If you edit ucos.h, rebuild the system. However, in my experience there are much better ways to create short delays than by changing the number of TICKS_PER_SECOND.
There is no need to fool around with the sim.gpt[1].port = h; calls to create these simple delays.
C:\Nburn\docs\NetworkProgrammersGuide\NNDKProgMan.pdf
C:\Nburn\docs\NetBurnerRuntimeLibrary\uCOSLibrary.pdf
By default, each tick "n" in OSTimeDly() is worth 50mSec. This can be changed by edits to the TICKS_PER_SECOND macro in ucos.h. The default for TICKS_PER_SECOND is 20, ie 1/20th sec = 50 mSec. If you edit ucos.h, rebuild the system. However, in my experience there are much better ways to create short delays than by changing the number of TICKS_PER_SECOND.
There is no need to fool around with the sim.gpt[1].port = h; calls to create these simple delays.