View previous topic :: View next topic |
Author |
Message |
Jeetdesai
Joined: 05 Jul 2018 Posts: 18
|
How to import a library from Arduino to CCSC? |
Posted: Wed Jul 18, 2018 8:06 am |
|
|
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
|
Re: How to import a library from Arduino to CCSC? |
Posted: Wed Jul 18, 2018 9:27 am |
|
|
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: 9229 Location: Greensville,Ontario
|
|
Posted: Wed Jul 18, 2018 9:52 am |
|
|
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
|
|
|
Jeetdesai
Joined: 05 Jul 2018 Posts: 18
|
|
Posted: Wed Jul 18, 2018 10:08 am |
|
|
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: 19518
|
|
Posted: Wed Jul 18, 2018 10:24 am |
|
|
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
|
|
Posted: Wed Jul 18, 2018 10:58 am |
|
|
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: 19518
|
|
Posted: Wed Jul 18, 2018 12:24 pm |
|
|
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. |
|
|
|