Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

call functions from library

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1073
Location: SYDNEY

australia.gif
PostPosted: Mon Apr 16, 2018 11:01 am    Post subject: call functions from library Reply with quote

How do I call the functions in the KS108 libray
initialize the lcd
turn on the lcd
I am trying to run multiple lcds and almost have it working

Regards Paul

(BASCOM-AVR version : 2.0.8.1 )
Back to top
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1503
Location: Basel, Switzerland

switzerland.gif
PostPosted: Mon Apr 16, 2018 1:47 pm    Post subject: Reply with quote

Hi,

If you look in the LIB/LBX file you'll see labels like:-
_Init_display
_gwrite_cmd
_clear_graph:
_clear_text:

So maybe you could just set the required registers then jump to the label. I'm not sure if that'll work, but it's worth a try.

Regards
Ian Dobson

_________________
Home of AVRTimer, the Bascom timer value calculator.
http://www.planet-ian.com

Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 539

poland.gif
PostPosted: Mon Apr 16, 2018 6:38 pm    Post subject: Reply with quote

This was sometime discussed but maybe I dont remember exact answear . Probably syntax was "!Call _initlcd" SO exclamation sign must precede the Call if you want to call some routine from library.

[EDIT] Updated to the LINK to the discussion Wink
Back to top
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1073
Location: SYDNEY

australia.gif
PostPosted: Tue Apr 17, 2018 10:29 am    Post subject: Reply with quote

Thank you EDC
I remembered there was a discussion I searched but could not find it
Even closer now I just have to work out the calls to make
So far I have one and a half LCDs need to initialize he other half (chip)
I am using a 2 x 4 cmos switch to chose CS1 & CS2
Regards Paul
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 539

poland.gif
PostPosted: Tue Apr 17, 2018 10:41 am    Post subject: Reply with quote

If they should show different content then I agree but if content is same on the both then I link them parallely and most of the "non serial" LCD`s works fine Very Happy
Back to top
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1073
Location: SYDNEY

australia.gif
PostPosted: Tue Apr 17, 2018 10:47 am    Post subject: Reply with quote

I have it working two 64 x 128 LCDs
I could have four as its a 2 x 4 switch
I had to select CS1 & CS2 manually
Then initialize both chips at once
also need to put pull down resistors on CS1 & CS2 as the switch goes high Z when not selected.
regards Paul

Code:


 Glcd_cs1 Alias Portc.2
 Glcd_cs2 Alias Portc.3

        'select port 1 on switch
          Reset Portd.7
          Set Portd.6
          Wait 1
   Set Glcd_cs1
   Set Glcd_cs2
         !call _Init_lcd
   Reset Glcd_cs1
   Reset Glcd_cs2

Wait 1
          'select port 0 on switch
            Reset Portd.7
             Reset Portd.6
           Wait 1
   Set Glcd_cs1
   Set Glcd_cs2
         !call _Init_lcd
   Reset Glcd_cs1
   Reset Glcd_cs2

Wait 1
 
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum