AL202C

Support for MOC/MOS/MOI/MOU/X-Board/MOP

Moderator: Mods

Post Reply
TimVukman
LCD Geek
Posts: 27
Joined: Sun Aug 10, 2008 7:20 pm

AL202C

Post by TimVukman »

Hi:

Perhaps I'm just not meant to use LCD's.

I connected my new MOI-AL202C into my circuit tonight and I can't seem to write anything to it.

It powers up with my board and I get the Matrix Orbital splash screen and then the display ignores me.

The bottom of page 6 has an * on a paragraph that then goes on to talk about reading from the display. Under Table 3, the * seems to refer to read timing and sets out timing delays.

Are timing delays required when writing to the display? Currently I have none.

My code should be sending 50 as the address, FE as the command byte and then a hex value of a character or display function.

For example, I have set the following test code in place

Code: Select all

// Init LCD Module
       set_AL202_I2C(MOI_address);
       hello(MOI_address);

Code: Select all


void set_AL202_I2C(byte MOI_address)
     {
     Wire.beginTransmission(MOI_address);  // Start I2C with Device Address
     Serial.println("MOI_address : ");    // 0x50
     Serial.println(MOI_address, HEX);
     Wire.send(MOI_command);          // 0xFE
     Serial.println("Command : ");
     Serial.println(MOI_command, HEX);
     Wire.send(MOI_I2C);                  
     Serial.println("Set I2C ");              // 160 Decimal
     Serial.println(MOI_I2C, DEC);
     Wire.send(MOI_2nd);
     Serial.println("Val1 ");                   // 0
     Serial.println(MOI_2nd, DEC);
     Wire.endTransmission();               // Stop I2C transaction
//
     delay(100);
     }

void hello(byte MOI_address)
     {
       Wire.beginTransmission(MOI_address);
       Wire.send(0x48);
       Wire.send(0x45);
       Wire.send(0x4C);
       Wire.send(0x4C);
       Wire.send(0x4F);
       Wire.endTransmission();
       //
     }
The serial print stuff is just an internal feature of the Arduino IDE and prints the information in a small window inside the IDE. There are actually no connections involved in hardware.

The result I get is here:

Code: Select all

MOI_address : 

50

Command : 

FE

Set I2C 

160

Val1 

0
It looks to me like this should work.

I would appreciate any and all suggestions (other than please give up and go back to using 7 segment displays driven through a MAX7219)

Also on this I2C bus is a DS1307 RTC which is running and keeping time quite nicely. That would indicate that my I2C connections are ok. If I crossed them when adding the display, the clock would not be working.

I have pullups (4.7K) to +5v on the SDA and SCL lines.

Thanks in advance

Tim Vukman

Ray
Matrix Orbital
Matrix Orbital
Posts: 742
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray »

The 0x50 address given in the manual is the 8 bit address the arduino documentation states
Note
There are both 7- and 8-bit versions of I2C addresses. 7 bits identify the device, and the eighth bit determines if it's being written to or read from. The Wire library uses 7 bit addresses throughout. If you have a datasheet or sample code that uses 8 bit address, you'll want to drop the low bit (i.e. shift the value one bit to the right), yielding an address between 0 and 127.
So shifting 0x50 one bit right would give you 0x28 give that address a whirl.

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hi Tim,

While you're taking a look at that address, you may want to throw some delays into that code as well. I'm still working on the MOI manuals so they aren't up yet, but the LK202-25 manual will be a good source for info; page 16 has the I2C communication summary.

~Troy
Troy Clark
Design & Development
Matrix Orbital

TimVukman
LCD Geek
Posts: 27
Joined: Sun Aug 10, 2008 7:20 pm

Post by TimVukman »

Ray:

Thank you so much for the Arduino link. I have been going through the site in detail as I was working on try to get a parallel display up before I switched to this new display. I tried both the 4bit and 8bit libraries. The 4 bit worked and I got garbage. The 8bit worked great but I really wanted to use I2C. I was going to use an XBoard that I had previously purchased but I accidentaly ordered an LCD that was 4 rows of 40.

It never even dawned on me to check the documentation on the Wire library they provide for I2C information. Sorry about that. After everything I went through with the 404 I was kind of expecting plug and play. Lessons learned!

Troy: I will download that manual Thanks for pointing it out.

Hi Troy: The only difference between this manual and mine is this text
[quote]Because of the considerable amount of delays necessary for I2C, it is suggested that the users explore
the possibility of using other built in graphic commands to clear areas of the display when refreshing all or
part of the display. For example, instead of sending the clear screen command, consider sending a rectangle
command with the proper size, this is much faster than clearing everything and re-drawing or writing spaces
over the area.[quote]

Is there some reason for not publishing any values or suggested values in the manual for timing requirements for the Write function? Do I need to use the values that are listed for the Read functions?

Please advise


Things are bound to start working better once I start talking to the correct address. I can't believe that never crossed my mind.

Thanks very much

Tim Vukman

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hi Tim,

Good to hear you've had a look at that manual, it sounds like I2C is making a little more sense. Unfortunately, delays are difficult to predict as they will change based on wire length and pull up resistance, which is why numbers are rarely published.

There are some values listed for the write, as well as read, in the LK manual, so you can try those to start, and modify as needed.

Let me know if you run into any more questions or concerns as you continue development with that new address.

Thanks,
~Troy
Troy Clark
Design & Development
Matrix Orbital

TimVukman
LCD Geek
Posts: 27
Joined: Sun Aug 10, 2008 7:20 pm

Post by TimVukman »

Hi Troy:

Amazing things happen when you use the correct address. My display is working perfectly and all I changed were two characters. I'm still kicking myself.

Perhaps you might have some advise on the subject of characters. Ideally, I would like to used the left half of the display in medium mode for four digits for my hours and minutes of my clock. I would like to use the right side as regular digits on two lines for things like date, and AM/PM Alarm on/off.

I don't see anything that says this sort of dual mode is supported and since there is no command to initialize normal character size I suspect I am out of luck.

I think I will try to create partial characters in the custom character storage. I should be able to create partials and write them on line1 and line2. I only have 0-9 to worry about so we'll see how it goes.

Thanks for your help.

Tim

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hi Tim,

Good to hear you've got that unit up and running. As for the screen idea here, I think we can make it work.

Basically, the screen only has eight custom characters, we then save different banks of those characters into memory, and load up one bank at a time. This is why characters, numbers, or graphs must be initialized by loading their custom bank into the display before printing to the screen.

Normal sized characters have no initialization, so you can write them at any time.

For the right and left break, you'll have to keep in mind where you'd like characters to start and move the cursor around accordingly.

Another problem may be the separator between minutes and seconds. You might look through the complete font for a special character to use, create your own custom, or just go with something like an ' o '.

Let me know if you have any more questions regarding more advanced text writing, and I'll do my best to provide answers and ideas.

~Troy
Troy Clark
Design & Development
Matrix Orbital

TimVukman
LCD Geek
Posts: 27
Joined: Sun Aug 10, 2008 7:20 pm

Post by TimVukman »

Thanks Troy:

I am certainly interested in the advanced font kind of stuff. If I could fake a split screen to get full size characters I would be most pleased.

I did put it on hold for the weekend to focus on getting everything running before I started playing around.

Saturday was very frustrating as for reasons unknown, it wouldn't accept any changes that I had made in my code without me powering it off and on.

I even lost the I2C address a couple of times. I have a device from a company called Diolan that allows me to see what is happening in I2C and there was no address showing for the clock.

It was easy enough to reset, but I have to power it off three times to reset the factory defaults. The first time it powers up and says I2C reset. The next time, I2C address and the third time it reinitializes.

At any rate it is working perfectly now. I will post again once I get to the custom characters.

Thanks for your input. If you have a layout of the display and which pixels can be addressed that would be handy.

Thanks

Tim

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hi Tim,

Glad to hear that unit has been functioning well for you, save for those I2C troubles. You may want to check out the data lock function, found in the LK manual, to try to lock down that I2C address.

Again, you'll probably want to check out the LK manual for a detailed layout of the pixels on the unit. Essentially, you've got 2 rows by 20 columns of characters made up of 5 by 8 pixels. Any of those pixels can be used to create custom characters, but the cannot be turned on or off individually; that's more of a graphic feature set.

Just let me know if you have any further questions once you take a look at those custom characters.

Thanks,
~Troy
Troy Clark
Design & Development
Matrix Orbital

TimVukman
LCD Geek
Posts: 27
Joined: Sun Aug 10, 2008 7:20 pm

Post by TimVukman »

Hi Troy:

I guess what I was looking for was a little more detailed on the pixel level. For example, when writing 5x8 characters, there is a space between the characters. I am assuming that there are no active pixels in this space.

I would similarily assume that there are no active pixels between the lines either.

Please confirm.

The manual certainly outlines how one would go about creating ones own font or graphic pattern and then writing that to the display.

What would be helpful would be a character set map that shows the characters that are stored in the bank0 - bank4 locations when the display is shipped.

I have the diagram (figure 6) from page 9 in the manual (page 20 in the LK manual that you refer to in your posts is the same one)

I don't think this diagram covers what is stored in the extra memory right now. It would be a shame to over-write something that I could already use.

I guess I could write the code easily enough to select each slot in each bank and display it, but a printed version would be easier to review.

Let me know if you have such a thing.

Thanks

Tim

Raquel
Matrix Orbital
Matrix Orbital
Posts: 796
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hello,

Try sending the following commands:

/254 / 192 / <n>/ - this will load what is in back <n> (0 to 4)
/ 0 / 1 / 2 / 3 / 4 / 5 / 6 / 7 / - this will draw the custom characters on the screen.

What we have set up is that
bank 0 - has custom characters needed to make the MO logo
bank 1 - has custom characters needed to make Horizontal bars
bank 2 - has custom characters needed to make Vertical bars
bank 3 - has custom characters needed to make Medium numbers
bank 4 - has custom characters needed to make Large number (on a 4 row display)

If you play with uProject, under the Alphanumeric tab, and click on the demo buttons, you will have a better idea how the custom characters are used.

Yes, it will be unfortunate having to spend time creating custom chars that might already exist on the displays.

I hope this helps,
Raquel Malinis
Design and Development
Matrix Orbital

TimVukman
LCD Geek
Posts: 27
Joined: Sun Aug 10, 2008 7:20 pm

Post by TimVukman »

Hi Raquel:

Thanks for your note.

I appreciate the code. That is most kind of you.

Can I use Large characters and regular characters at the same time?

It would be nice to have 4 large characters for the numbers for the clock on half the display and then regular text for date and day of the week and alarm set for time, etc. ?

It would likely be worth buying a 4 x 20 display if I can do that.

What is the width of the Large characters? Do they perhaps use two columns instead of 1 for each character?

Thanks

Tim

Raquel
Matrix Orbital
Matrix Orbital
Posts: 796
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hello Tim

Yes, it is possible to have large digit(s) and then have some text beside it.
The large numbers are 3 columns by 4 rows big.

On a 4x20 display, you can fit up to 6 large digits side by side with 2 extra columns to spare.
Raquel Malinis
Design and Development
Matrix Orbital

TimVukman
LCD Geek
Posts: 27
Joined: Sun Aug 10, 2008 7:20 pm

Post by TimVukman »

Thank you:

That is the confirmation I was looking for.

Which display would you recommend? I would probably want to stick with Red but I guess anything would good readability and I2C would be fine.

I will look over the site tonight.

Tim

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hi Tim,

Great to see you've got all the digit info you were looking for, sounds like you are searching for a 20x4 unit now. The red is a good way to go, if you want a little easier to read you may go for something like a yellow green or gray white. The best readability will definitely come from a VFD style unit, VK204-25, however, you'll see a rise in cost there.

Happy shopping, and just let us know if you have any further questions or concerns.

Thanks,
~Troy
Troy Clark
Design & Development
Matrix Orbital

Post Reply