Jump to content

GLCD 128X64 in MB64E and MBLC


cimo
 Share

Recommended Posts

hi

so, i ve happily built a new core (thanks sasha!) and connected my GLCD 128X64, but at startup of the LC application nothing happens just a blank screen, same with MB64E and with the LCD test app.

In the LC application i ve only changed the code as follow;

#define LCD_USE_SECOND	0		; the emulation handles with two character LCDs if 1

#define LCD_EMU_COL     55		; number of emulated columns (characters per line)

					;    o graphical LCDs: use 55 (like a Logic Control)

					;    o one 2x40 LCD: use 40   (unfortunately..)

					;    o two 2x40 LCDs: use 55  (like a Logic Control)

-Is this all i have to change in the code to tell the box i have a GLCD connected?

-Will MB64E accept a GLCD 128X64 ? Where should i change the code?

-the definition of pins is different in the mbhp_glcd.pdf and in the datasheet of my GLCD, i assumed that

R/S  is  D/I (H:display data L:display instruction)

or

is R/S  ----  /RES (Reset signal) ?

CS1 ---- CSA

CS2 ---- CSB

CS3  not conneted

CS4  not conneted

txxx

simone

Link to comment
Share on other sites

hi and thanks fo rthe input

it sounds still too obscure to me, i ve made a little search but i can t really figure out what is the "auto interface get" and also

you need to use the PIC ID

does it mean i have to change the PIC ID ?

cheers

simone

Link to comment
Share on other sites

ok now i have the two GLCDs hooked up and working, just that the resolution is now 256X64 so that in the right corner there is a 16X64 stripe of pixels unused...

Where can i change the resolution of the output to the GLCD? if it is not possible can i change the offset so that i can center the image?

I think it has to be done at the MIOS level because i can see that the stripe on the right appears before that MBLC is launched, that means that the MBLC app is not involved in the screen setup .. right?

this LC stuff rocks!! if i can tweak it at my will we re gonna have a funny winter together!!  :P

tx TK and thanks to all the MBers for the support

Link to comment
Share on other sites

hi

well, i ve found out that the whole area (256X64) can be used by the application but it is not initialized by MIOS!! That means that i can move icons and chars on the "extra area" (the last 16 columns of pixels) but the area not covered by any icon or letter will be with all the pixels lit on.If you have any suggestion how to deal with that you are very welcome but for the moment i can keep on with the rest of the code i need and leave this as it is as i am only in testing mode..

tx

simone

Link to comment
Share on other sites

hi

sorry for my blurbing but maybe i can come out with something useful for others...

... i think i got the point, maybe: i think that the way it is setup by TK, for a 240X64 GLCD all the icons and chars cover the whole display.Now if i move things around the screen then i get scrambled pixels where there is nothing to be print, so if i have different setups on the 4 different pages, i have to organize the elements so that they will cover the whole area otherwise there are traces of the elements of the previous page left there.... it doesn t make too much sense to me, why doesn t the screen resets every time i change page? is the unconnected reset pin involved in this mistery? mmmm

The other screen related thing i am working around is the adaptation of the elements to the new resolution (256X64) so that they will fit nicely and symmetrically, for example i moved the smpte element on the right screen so it is not split and that works ok, also the knobs are ok, sitting very nicely.Still i need to fix the host messages, using the distance between chars is not enough i need to find out where the app creates the layout and add some 1 or 2 spaces between each channel..

as usual any input is welcome

simone

Link to comment
Share on other sites

..anybody knows how to deal with the convpix.pl script? it seems like it doesn t like too much files saved with IconPX (windows), IconPainter (Java over OSX) and Gimp (OSX) won t save xpm format for some plugin error.. there is no mention to the convpix script in the forum, neither in google..  ??? ???

simone (still dealing with scrambled pixels)

Link to comment
Share on other sites

not really state of the art but a good start:

256X64.JPG

so the knobs can easily be moved (although i need to resize the icons for now there are spaces in between them) but the host messages and horizontal meters need to be fixed, now they are centered but not really aligned with the icons, what i need to do is putting a space in between each channel, that should work:

;; print host messages at position 2/1 (4 pixels between chars)

SET_GLCD_HOST_MSG LC_SMALL_FONT, 2, 1, 4

now we have 7 chars each channel (6+1 space) multiplied 8 makes 56 minus 1 (the last channel doesn t need space i suppose) then it is 55, that remember me something  ;) .55 chars of 4 pixels each (the chars are 5 pixels wide but the distanse is set to 4) it makes 220 pixels, it starts at x=2 so there should be 18 pixels left on the right side.

If i can add 1 extra space in between each channel (and believe me i will find out how to do it) it ll be 6+2=8 X8=64 X4=256 and that also remembers me of something.. no way to use 5 pixels wide chars, it doesn t work, nevermind

Now let s take the knobs icons:

;; print knobs at position 8/4 (28 pixels between icons)

SET_GLCD_KNOB LC_KNOBS_ICONS, 8, 4, 28

they are 48 pixels wide (and 24 high) but they are originally placed at 28 pixels of distance and the first one starts at x=8 so it is 28X8=224 +8=232 ,8 pixels left we keep them on the right side so they are centred in the display.

With a resolution of 256X64 it can be easy: icons 32X24 (why not 32X32?) they will cover the whole width of the display (32X8=256).

end of the blurbing..

Link to comment
Share on other sites

Next step:

Actually the original icons are 32X24 and not 48X24 so placing them at x=0 at 32 pixels of distance should fill the display horizontally but it doesn t, they are displayed as 28X24 (??) with 4 pixels

Anyway here comes the solution: as stated in lc_glcd.inc

;; don't print if LCD_SMPTE_BEATS_FONT_H is 0

and

;; don't print if LCD_MTC_FONT_H is 0

etc etc

and

;; --------------------------------------------------------------------------

;;  This function is called by LC_GLCD_LEDStatusUpdate when

;;  "90 72 7F" has been received

;; --------------------------------------------------------------------------

LC_GLCD_Print_BEATS

;; force display mode to BEATS

bcf LC_STAT, LC_STAT_SMPTE

so if you dont want these elements to be displyed just set H(second value)=0 and not erase the entire entry, as i did  :P

MIOS is a text adventure wasn t it?

As for convpix.pl and xpm editors the only solution i ve found is to edit the .xpm edit it graphically, save it then open the original file and the edited one in a normal text viewer (SMULTRON in this case) and compare the 2 files: when and if you get there you ll easily see what you have to do.It works!

EDIT: my second page adapted to the new resolution

smpte.JPG

Link to comment
Share on other sites

i had to change something in the source code of MIOS

A custom driver for your custom LCD is the trick here :)

Rather than modifying MIOS_GLCD0.inc, you can copy it's contents into your app_lcd.inc (some minor editing is required) and set your PIC ID to use a custom LCD. All set :)

PS we just chatted about this but I put it here also for others to refer to ;)

Link to comment
Share on other sites

hi

i tried that and i got a bunch of errors, so i think i will keep it as it is and dig on it later on..

...anyway i came to think that if the GLCD0 driver is written for the KS0180 types and the KS0180 driver deals with 64X64 "pieces" then it is not that strange to have MIOS dealing with a 256X64 resolution.

If you are wondering if i, mr nobodycoder, am daring to say that i have my own opinion about MIOS source code and TK s work, well yes it s just an opinion and

;D ;D ;D

"I have been given USER status ONLY in order to BE HELPED out - my opinions are NOT rules and you can feel free to tell me where to shove them"

;D ;D ;D  -that was a nice one btw-

now seriously: i understand that 240X64 is the next step in commercial GLCD after 128X64 but the 2X 128X64 is a cheap and elegant solution for those who have found the non-alignment stuff on a 8 channel MBLC with 240X64 GLCD the reason why to stick to the 2x 2X40 CLCD setup.

At this point my only question would be: if i set the function

MIOS_GLCD0_ClearInnerLoop

to clear all the 256 columns instead of only 240 will that take so much more CPU cycles as to justify the default settings (x=240) ?

As a last thought i have to admit that touching the MIOS source code scared me to hell but it s been the only easy way out, maybe not so elegant and code-wise but as somebody said, reverse engineering is the best way to get the whole idea of how MIOS work.

here the new pics of page0 and page3:

256X64_nosc.JPG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...