Jump to content

Changing CS pin KS0108


Cubess95
 Share

Recommended Posts

Hi guys,

I have built a midibox close to a midio128 with a 128*64 Graphic LCD with a KS0108B controller.

This controller have 2 CS (chip select), but on my project, CS1 & CS2 are not connected to J5C (A8, A9) but to the 19th et 20th pins of the LPC1769.

I don't find in wich files i can define the pins. Any helps ?

Thx,

Cubess

Link to comment
Share on other sites

Hi,

the pins are directly programmed into the universal driver: http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fmodules%2Fapp_lcd%2Funiversal%2Fapp_lcd.c

Search for MIOS32_BOARD_J28

Currently they can't be changed from external, the source code has to be modified directly.

There will be a "weak" function reference in future which will allow to overload the CS pin initialisation and control from external.

Best Regards, Thorsten.

Link to comment
Share on other sites

Thx for the response.

I see a fault in my first post, the initial port isn't the J5C, i'm working on the LPC1769 so it's the J28. But i think that you corrected my mistake yourself seeing your post.

So if I understand you well, i have to change the code here :

#elif defined(MIOS32_FAMILY_LPC17xx)

    int cs;

    for(cs=0; cs<4; ++cs)

      MIOS32_BOARD_J28_PinInit(cs, MIOS32_BOARD_PIN_MODE_OUTPUT_PP);

#else

So I have to change the function "MIOS32_BOARD_J28_PinInit()" by another function I create myself isn't ?

Where is the code of this function, so that I can inspire myself with it ?

I already seen these lines in the app_lcd.c file but I didn't find where the "MIOS32_BOARD_J28_PinInit()" function is written.

Sorry i'm not a programmer even if I know some langages (including C).

Regards,

Cubess

Link to comment
Share on other sites

The MIOS32_BOARD_* functions for LPC17xx are located here:

http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fmios32%2FLPC17xx%2Fmios32_board.c

By searching for MIOS32_BOARD_J28 you will also find the exact pinning.

Note: this file shouldn't be changed, if you need something similar, copy&paste&rename the functions in your application.

Best Regards, Thorsten.

Link to comment
Share on other sites

Ok thx,

I just have one more question :

Originally, how the CS are connected to J28 ?

CS1 is connected to SDA, SC, WS or MCLK ?

And for CS2, 3, 4 ?

I ask you in the case I can't carry out the programming, so that I can go back to J28.

Regards,

Cubess

Link to comment
Share on other sites

  • 1 month later...

Thanks again Thorsten !

Sorry to answer so late but I've had a lot of work.

I have another problem now. I have used an application form the mios32_test directory for the ks0108 to test it. The terminal of MIOS Studio print :

"WARNING: your core module hasn't been configured for the KS0108 GLCD!

Please do this with the bootloader update application!"

Lines above, it's indeed print : "lcd_type: 0x00 (CLCD)"

So it seems that my midibox is configured for a character LCD and not a graphic LCD. How can I change this ?

I don't understand why it talks about the bootloader. I haven't define any LCD type while I have uploaded the .bin with the LPCXpresso soft from code_red.

Edited by Cubess95
Link to comment
Share on other sites

The LCD parameters are stored in the bootloader configuration range and read by the "universal" LCD driver.

Advantage: somebody can run any application with the display and doesn't need to recompile the code!

(not true for your special case of course...)

The configuration details are described at the bottom of this page:

http://www.ucapps.de/mios32_bootstrap_newbies.html

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi Thorsten.

If I understand you well, I have to open MIOS Studio and type those commands in the terminal. But those commands doesn't work, MIOS Terminal said me it doesn't know those commands. And when I type help, those commands are not in the list.

Maybe I'm doing it wrong ? I have noticed that the commands are not always the same. For exemple, i can type "help" with the midio128 app but not with the midibox LC app. The commands describe at the bottom of your link works only in special conditions ?

Best regards,

Cubess

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...