CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How to import a library from Arduino to CCSC?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jeetdesai



Joined: 05 Jul 2018
Posts: 18

View user's profile Send private message

How to import a library from Arduino to CCSC?
PostPosted: Wed Jul 18, 2018 8:06 am     Reply with quote

I am using the CCSC compiler to write a code in a PIC18 MCU.

I would like to import a library from Arduino. Is it even possible to import a library from Arduino to CCSC? If yes, how can I do that?

The library I would like to import is 'U8g2'. I downloaded the library in Arduino via the Library Manager. But I wasn't able to locate any files on my hard disk with that name.

Thank You in advance.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: How to import a library from Arduino to CCSC?
PostPosted: Wed Jul 18, 2018 9:27 am     Reply with quote

Jeetdesai wrote:
I would like to import a library from Arduino. Is it even possible to import a library from Arduino to CCSC? If yes, how can I do that?

There is no ability to just click and import it.

Jeetdesai wrote:

The library I would like to import is 'U8g2'. I downloaded the library in Arduino via the Library Manager. But I wasn't able to locate any files on my hard disk with that name.

You would need to translate all the source files in it to CCS. That's a large
project and not really worth it.

Tell us what display you want to use. Maybe we can find some CCS code
for it.
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jul 18, 2018 9:52 am     Reply with quote

https://www.arduinolibraries.info/libraries/u8g2

Is what a quick google showed me....
seems to have several drivers in one package
As PCM P points out, post which display module you have since you probably don't need ALL of the u8g2 software.
Jay
Jeetdesai



Joined: 05 Jul 2018
Posts: 18

View user's profile Send private message

PostPosted: Wed Jul 18, 2018 10:05 am     Reply with quote

Quote:
Tell us what display you want to use. Maybe we can find some CCS code
for it.


I'm using the 'CFAL12864G-024W' display. The following is the link: https://www.crystalfontz.com/product/cfal12864g024w-128x64-2-4inch-white-oled-module
Jeetdesai



Joined: 05 Jul 2018
Posts: 18

View user's profile Send private message

PostPosted: Wed Jul 18, 2018 10:08 am     Reply with quote

My goal is to display Alphabets, Numbers and Shapes(rectangles, lines).

But even if I can get a code for lighting the entire screen[lighting every pixel], it would help me a lot.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Jul 18, 2018 10:24 am     Reply with quote

Drivers here:
<http://www.ccsinfo.com/forum/viewtopic.php?t=52861>
and using less RAM
<http://www.ccsinfo.com/forum/viewtopic.php?t=54453>

The SSD1309, is compatible with the SSD1306, _except_ be very aware of reset. I found I had to have a capacitor on the reset pin, which held it low for a significant time after power on, and then had a good delay before trying to initialise (500mSec). Have these running on several boards using the second driver pointed to above. Without the reset, got sort of 'semi random' odd wake up problems.
Jeetdesai



Joined: 05 Jul 2018
Posts: 18

View user's profile Send private message

PostPosted: Wed Jul 18, 2018 10:58 am     Reply with quote

Thank you for the quick response Ttelmah.

I noticed the first link uses the I2C protocol. I'd like to use the SPI protocol.
Would you recommend to use the '#use spi' command or 'setup_spi()' command?
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Jul 18, 2018 12:24 pm     Reply with quote

SPI uses more pins, hence most people with limited resources prefer the I2C. Even '3-wire SPI' needs four pins (D/C, CS, SDIN, SCLK). The drivers would need significant modifications to use SPI. No device address, hardware CS instead. However SPI is potentially a little faster. Even though 4-wire SPI is listed, reading is still not allowed using serial mode. There are two jumpers on the display that select SPI or I2C mode. It's up to you whether you want to just jumper the display for I2C and use the existing driver, or re-write the driver and use SPI.

#USE SPI

It is more powerful and more flexible.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group