40X2 3V version

Svejk

Senior Member
I'm about to use for first time a Picaxe 40x2 3V. The project will have one or two Eprom and a Maths coprocessor via I2C, an serial input at LVTTL and a graphic LCD also at LVTTL. I would like to do the programing through serial port.

Are any precautions to be taken?

Thank you,
Svejk
 

moxhamj

New Member
Sounds a great project. There are no precautions I can think of. Just follow the existing schematics (I think there are examples for all these). Hmm - maybe not the graphics LCD. I've pondered using these too. They are getting cheaper and seem to have a similar interface to the text LCDs. I wonder if there is a 'how to' example out there?
 

lanternfish

Senior Member
I'm about to use for first time a Picaxe 40x2 3V. The project will have one or two Eprom and a Maths coprocessor via I2C, an serial input at LVTTL and a graphic LCD also at LVTTL. I would like to do the programing through serial port.

Are any precautions to be taken?

Thank you,
Svejk
Serial from the 40X2 to the LCD should be okay. Serial in may be an issue.

I2C I'm not sure about. This may help - http://www.nxp.com/acrobat_download/applicationnotes/AN10441_1.pdf

A reduced component count version of this is here - http://www.standardics.nxp.com/support/documents/i2c/pdf/an97055.pdf

This can also be used as a general purpose 5V to 3V bidirectional level shifter for serial (TTL level), I/O lines, etc.

I think Sporakfun or Poliou have a board that provides 2(?) of these circuits. It is approx 25mm x 12mm.

Cheers
 

Svejk

Senior Member
Thanks for replyes. So far I've seen in eprom and maths coprocessor datasheets that are working at 3 V. I expect I2C to work with just the pull-up resitors but I'm not sure thou.

The GLCD is similar to the one that Surplustronic sell and I've driven this succesfully before.

I'm more concerned with the serial programming. Should I use a RS-232 IC?
 
Last edited:

moxhamj

New Member
No, you don't need a rs232 IC for serial programming. The two resistors have been designed to work fine with picaxe chips and with RS232 voltage levels.

That is a nice price for a display, and that is NZ$ too. Have you got some code for driving that display - I'd be interested to see that please.

Is the display 5V? If so, would there be issues going from 3V to 5V? Or (as is often the case but not always), would a 3V count as a logic high?
 

Svejk

Senior Member
The Agena Display is 5V. The one that I intend to use is 3V and uses a similar chip.

I've attached the "driver" code writen and a photo of results. My apologies for not comenting it [it was written in a hurry] and for the glitch with the small type font, the eeprom choose this moment to make trouble as per Murphy's Law.

Edit: The code is not optimised.
 

Attachments

Last edited:

moxhamj

New Member
Nice display. 3V is great. Code looks very interesting - thanks for that. With 5x5 characters you can fit a lot of characters on a display. Thanks++ for the post - I might get one of these displays.
 

lanternfish

Senior Member
Thanks for posting the code. Bought one of these from Surplustronics a while back but haven't used it yet. This will go a long way to helping me understand how to drive it. Cheers.
 

Svejk

Senior Member
Actually isn't that hard to drive it.

The screen is split in two parts each controled by a ks0108. A high on CS1 or/and CS2 will select the which part of the screen will be writen.

RS is register select to tell the chip if is data or command at DB0-DB7
WR is for writing or reading data to DB0-DB7
E is enable. A pulse on this will enable data to chip.

Each side of screen is a 64x64 matrix of dots. From left to right each column is addressed as yAddr | StartLine (StartLine: 0..63). Verticaly the screen is split into 8 pages. A byte will be writen from top with bit0 first. xPage | Page (Page: 0..7) will address the page.

Using Page = 3 and StartLine = 31; sending %10000000 will plot a dot aproximately in the middle of Screen1.
 

MBrej

Member
From the Manual:
http://www.rev-ed.co.uk/docs/picaxex2.pdf

The low voltage options are known as 28X2-3V and 40X2-3V. It is recommended that these 3V parts are only programmed via the AXE027 USB cable, as this uses logic level signals as opposed to RS232 (up to +/-12V) serial signals.
No, you don't need a rs232 IC for serial programming. The two resistors have been designed to work fine with picaxe chips and with RS232 voltage levels.
Well were the two resistors designed to be used with a 5V picaxe rather than a 3.3V one? Should you want to be careful and download from a 'proper' RS232 port you could always use a transistor as shown in the attachment. It works fine for me.

Matt
 

Attachments

moxhamj

New Member
Sorry to hijack the thead a bit but the graphic display driver is just brilliant. I'm almost thinking it could eventually go in a new version of the #3 help file, underneath all the info about driving character displays. Or at the very least, in the completed project section. After a bit of documentation and some photos maybe. A quick question first - are you storing character images in eeprom or I2C or somewhere? And are these in different font sizes - eg 5x5 and bigger? And where do these character sets/font bitmaps come from?
 

Svejk

Senior Member
@ MBrej: Thanks for schematic, I think that's what I'll use.

@ Dr_Acula: The character bitmaps are stored in eeprom via I2C. I've generated them using TheDotFactory. For this example I've generated only characters 33..127 for 8x6 characters, the digits only for 16x8 and capitals only for 5x5. One image 64x64 is also stored in eeprom.

I can make a tutorial but please consider that English is not my first language [I'm born and breed in Transylvania :)] and it will need some sort of proofing.
 

lanternfish

Senior Member
@ MBrej: ... I can make a tutorial but please consider that English is not my first language [I'm born and breed in Transylvania :)] and it will need some sort of proofing.
I think you will find we will be more than happy to assist you with the proofing. Well done on an excellent piece of code.

Cheers
 

moxhamj

New Member
TheDotFactory. That is really clever. Makes it much easier to generate fonts.

Your English is perfect. No problems there.

So, you run the font program, and does that generate a file? And how do you get that data into the eeprom? Is that in the main program or is it another program?

I know you said it was easy, but it looks very complicated, but your code makes it easy.

With 5x5 characters, I think your display is by far the cheapest display I've seen in terms of $ per character. Do you have one line between each character? (so 5x5 actually takes 6x6)

I'm starting to think crazy thoughts now. Text and graphics on a picaxe. Small windows that you can open and close. Little buttons, text boxes. A GUI for a picaxe...
 

Svejk

Senior Member
The DotFactory generates a file that can be manipulated [with MS Word for example]. For eeprom I've writen a little VB6 routine for writing x no of bytes at y address in eeprom via serrxd. Another little program on Picaxe side takes care of that.

The 5x5 characters includes the space (hx00) after each character. In fact isn't a true 5x5 character as there are some symbols that use 6 bytes. The height of a 5x5 character is still 8 bits but it permits a line on top or bottom (for boxes for example)

As for picaxe GUI it can be done but will be slow.
 

moxhamj

New Member
So clever! A vb6 program and a decoder at the other end. That is my sort of code - I like it! It sounds like you are doing some really cool things here. That is definitely worth a writeup if you are happy to share the code.

I'm thinking of a generic 'terminal' using the screen and a picaxe. Send it data bytes one at a time at a time at a nominated baud rate and it prints them on the screen. If it gets to the end of the line wrap around to the next line. 13 returns to the beginning of the line. 10 goes to the next line. If on the bottom line, all the others scroll up. if you want to get fancy you could add the ESC[ sequences for VT100 terminals, eg clear screen, and move cursor to x,y.

(you are already one step ahead as you can do graphics too)

I've written a terminal program for a 20x4 LCD but there is only so much you can display on a 20x4, and your display is the same price but has a lot more space.

But I digrees. You were asking us for some help at the beginning and now I am asking all these questions. I'd like to give something back - is there some way we can help you?
 
Top