Sonsivri

Electronics => Pic C Languages => Topic started by: Bobbla on April 19, 2013, 12:29:25 12:29



Title: Libraries
Post by: Bobbla on April 19, 2013, 12:29:25 12:29
Hallo

I've written a small library, or at least that is what it is suppose to be. Its for the I2C temperature sensor TC74, its written in mikroC PRO for dsPic 6.0.0. I'm wondering because I want to make myself a "standard" of sorts for writing libraries.. and I was wondering if there was anything that should be changed.

Also, if you have any "standard" of your own please share the information.

Thank you.


EDIT: Really?? nothing wrong?? nothing to add?? I find that hard to believe.


Title: Library driver OLED SSD1306 I2C interface
Post by: Catcatcat on May 17, 2013, 04:33:58 04:33
Library driver OLED SSD1306 I2C interface.
(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/catcatcat_oled091.png)
more details on my website Catcatcat (http://catcatcat.d-lan.dp.ua/en/skachat/biblioteki/biblioteka-dlya-oled-drayvera-ssd1306-interfeys-i2c/)
video http://www.youtube.com/watch?feature=player_embedded&v=ZCFA_0ZcAKw (http://www.youtube.com/watch?feature=player_embedded&v=ZCFA_0ZcAKw)
In an attachment schemantic and the demo and library (MPLAB X IDE v1.80)...


Title: Re: Libraries
Post by: metal on May 17, 2013, 08:18:10 08:18
what connector did you use?


Title: Re: Libraries
Post by: Catcatcat on May 17, 2013, 08:28:58 08:28
what connector did you use?
in these indicators is designed connector soldered directly to the PCB, but you can unsolder and wires


Title: Graphics library for SSD1306 driver
Post by: Catcatcat on May 20, 2013, 05:35:27 05:35
Graphics library for SSD1306 OLED driver, interface 8080
(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/SSD1306_8080_02-150x150.png)(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/SSD1306_8080_03-150x150.png)
Library + demo example (MPLAB X IDE v1.80, XC8 C Compiler V1.12)
Wiring diagram of the indicator in pdf

Video demo example http://www.youtube.com/watch?feature=player_embedded&v=hkOVvUeIPKA (http://www.youtube.com/watch?feature=player_embedded&v=hkOVvUeIPKA)

Additional information on the site http://catcatcat.d-lan.dp.ua/en/skachat/biblioteki/graficheskaya-biblioteka-dlya-drayvera-ssd1306/ (http://catcatcat.d-lan.dp.ua/en/skachat/biblioteki/graficheskaya-biblioteka-dlya-drayvera-ssd1306/)


Title: Re: Libraries
Post by: Catcatcat on May 20, 2013, 11:14:41 11:14
immediately and update. still no signal cs sometimes incorrectly being read. so I had to use it.

(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/Catcatcat_electronics_CNK109630_8080_v1.1-565x600.png)

see update


Title: Re: Libraries
Post by: Catcatcat on May 28, 2013, 07:11:59 19:11
Graphics library for color OLED displays such CNK111063, UG-9696TDDCG02 on the driver SEPS114A
(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/Catcatcat_electronics_SEPS114A_14.png)(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/Catcatcat_electronics_SEPS114A_15.png)(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/Catcatcat_electronics_SEPS114A_16.png)

Videos to view (http://youtu.be/O8v2htftLxc)

More details on my website http://catcatcat.d-lan.dp.ua/en/skachat/biblioteki/biblioteka-dlya-oled-drayvera-seps114a-interfeys-6800/ (http://catcatcat.d-lan.dp.ua/en/skachat/biblioteki/biblioteka-dlya-oled-drayvera-seps114a-interfeys-6800/)

Parallel Interface 6800, Microchip MPLAB XC8 C Compiler V1.12

(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/Catcatcat_electronics_SEPS114A_02-600x600.png)


Title: Re: Libraries
Post by: LithiumOverdosE on May 29, 2013, 01:11:42 01:11
@Catcatcat

Your website is quite good. ;)


Title: Re: Libraries
Post by: Catcatcat on June 10, 2013, 09:36:59 09:36
(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/05/Catcatcat_electronics_SEPS114A_01-600x600.png)

Graphics library for the driver SEPS114A SPI interface for PI24, the compiler MPLAB XC16 v1.11


Title: Library Sensor DHT11
Post by: Catcatcat on August 29, 2013, 06:09:46 18:09
Library Sensor DHT11
(http://catcatcat.d-lan.dp.ua/wp-content/uploads/2013/08/Catcatcat_dht-11_150.png)
The library and demo work, MPLAB ® X IDE v1.85, MPLAB ® XC8 Compiler v1.20

more... http://catcatcat.d-lan.dp.ua/en/skachat/biblioteki/biblioteka-dlya-datchika-dht11/ (http://catcatcat.d-lan.dp.ua/en/skachat/biblioteki/biblioteka-dlya-datchika-dht11/)

sensor description ... http://catcatcat.d-lan.dp.ua/en/skachat/primeryi-postroeniya-koda-programm-dlya-pic-kontrollerov/dht11-datchik-vlazhnosti-i-temperaturyi/ (http://catcatcat.d-lan.dp.ua/en/skachat/primeryi-postroeniya-koda-programm-dlya-pic-kontrollerov/dht11-datchik-vlazhnosti-i-temperaturyi/)


Title: Re: Libraries
Post by: lcn on October 07, 2014, 05:37:48 17:37
Hello Catcatcat

Thanks for sharing your codes for SSD1306 OLED displays.


May i ask you some questions :

- Did you also get SPI mode working with PIC18 ?

- Does your code could work with ADAFRUIT SSD1306 OLED displays  : http://www.adafruit.com/product/326

- Where could we buy from Europe OLED displays (CNK109632 ) working with your libraries  ?
http://voron.ua website has no English language ( or, i did not find it yet  :) )


I tried to compile your project code : oled_8080_Grafica_web with MPLAB X and XC8 v1.12 but i get outstanding warning that i can't fix :
Can you help me please ?

Code:
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'Z:/Electronique/SSD1306/oled_SSD1306_8080G.X_web/oled_SSD1306_8080G.X_web'
make  -f nbproject/Makefile-default.mk dist/default/production/oled_SSD1306_8080G.X_web.production.hex
make[2]: Entering directory 'Z:/Electronique/SSD1306/oled_SSD1306_8080G.X_web/oled_SSD1306_8080G.X_web'
"C:\Program Files (x86)\Microchip\xc8\v1.12\bin\xc8.exe" --pass1  --chip=18F25K20 -Q -G  --double=24 --float=24 --emi=wordwrite --rom=default,-7CF0-7FFF --opt=default,+asm,-asmfile,+speed,-space,+debug --addrqual=ignore --mode=pro -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,+plib "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s"    -obuild/default/production/mail.p1  mail.c
"C:\Program Files (x86)\Microchip\xc8\v1.12\bin\xc8.exe" --pass1  --chip=18F25K20 -Q -G  --double=24 --float=24 --emi=wordwrite --rom=default,-7CF0-7FFF --opt=default,+asm,-asmfile,+speed,-space,+debug --addrqual=ignore --mode=pro -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,+plib "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s"    -obuild/default/production/graphic.p1  graphic.c
"C:\Program Files (x86)\Microchip\xc8\v1.12\bin\xc8.exe"  --chip=18F25K20 -G -mdist/default/production/oled_SSD1306_8080G.X_web.production.map  --double=24 --float=24 --emi=wordwrite --rom=default,-7CF0-7FFF --opt=default,+asm,-asmfile,+speed,-space,+debug --addrqual=ignore --mode=pro -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,+plib "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s"     -odist/default/production/oled_SSD1306_8080G.X_web.production.cof  build/default/production/mail.p1 build/default/production/graphic.p1    
Microchip MPLAB XC8 C Compiler V1.12
Copyright (C) 2012 Microchip Technology Inc.
:: warning: (1273) Omniscient Code Generation not available in Free mode
:0: error: (1347) can't find 0x2E8 words (0x2e8 withtotal) for psect "text10" in class "CODE" (largest unused contiguous range 0x154)
:0: error: (1347) can't find 0x15C words (0x15c withtotal) for psect "text15" in class "CODE" (largest unused contiguous range 0x154)
:0: error: (1347) can't find 0x11E words (0x11e withtotal) for psect "text16" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0xD4 words (0xd4 withtotal) for psect "text11" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0xBC words (0xbc withtotal) for psect "text20" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0xA8 words (0xa8 withtotal) for psect "text21" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x84 words (0x84 withtotal) for psect "text3" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x74 words (0x74 withtotal) for psect "text7" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x69 words (0x69 withtotal) for psect "idataBANK1" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x64 words (0x64 withtotal) for psect "cinit" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x62 words (0x62 withtotal) for psect "text22" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x40 words (0x40 withtotal) for psect "text8" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x40 words (0x40 withtotal) for psect "text13" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x3E words (0x3e withtotal) for psect "text24" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x32 words (0x32 withtotal) for psect "text1" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x24 words (0x24 withtotal) for psect "text23" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x1A words (0x1a withtotal) for psect "text19" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x16 words (0x16 withtotal) for psect "text2" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x12 words (0x12 withtotal) for psect "text17" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0x12 words (0x12 withtotal) for psect "text18" in class "CODE" (largest unused contiguous range 0xA)
:0: error: (1347) can't find 0xE words (0xe withtotal) for psect "idataBANK0" in class "CODE" (largest unused contiguous range 0xA)
:0: advisory: (1) too many errors (21)
(908) exit status = 1
nbproject/Makefile-default.mk:132: recipe for target 'dist/default/production/oled_SSD1306_8080G.X_web.production.hex' failed
make[2]: *** [dist/default/production/oled_SSD1306_8080G.X_web.production.hex] Error 1
make[2]: Leaving directory 'Z:/Electronique/SSD1306/oled_SSD1306_8080G.X_web/oled_SSD1306_8080G.X_web'
nbproject/Makefile-default.mk:75: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[1]: Leaving directory 'Z:/Electronique/SSD1306/oled_SSD1306_8080G.X_web/oled_SSD1306_8080G.X_web'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

BUILD FAILED (exit value 2, total time: 13s)


Many thanks,


Title: Re: Libraries
Post by: Catcatcat on October 11, 2014, 07:51:55 19:51
But try these files, I used it in a project with the radio receiver used indicative serial I2C. Video work with display http://youtu.be/PMQ2pezKwzI


Title: Re: Libraries
Post by: lcn on October 23, 2014, 09:58:31 09:58
Thanks,

In your web site what code should I download if I want to use SSD1306 working with SPI interface ?



Title: Re: Libraries
Post by: Catcatcat on October 23, 2014, 06:27:17 18:27
I did not have such a need, therefore, with the driver I used only I2C. In the near future I will return to this indicator is not planned. SPI I have only used the driver SEPS114A.


Title: Re: Libraries
Post by: lcn on October 24, 2014, 09:36:55 09:36
Thanks, i will use I2C circuitry then.
I can't register on your website, so i can't download your lastest SSD1306 driver.


Does your library will work with any screen size : 0.96" or 1.3"
or, it needs to be modified to get it working with 1.3" screens ?



Title: Re: Libraries
Post by: Catcatcat on October 24, 2014, 07:23:31 19:23
Will work with any display size.
Try again to join and I will check that there is not obtained.


Title: Re: Libraries
Post by: lcn on October 25, 2014, 10:38:28 10:38
Thanks CATCAT, i received a password to log-in on your website.
However i did not find the XC8 project archive for SSD1306, can you tell me where i could download it ?

Could i use any PIC18 MCU with I2C interface ?
Is the crystal ( Fosc ) speed is very important for SSD1306 ?


Title: Re: Libraries
Post by: Catcatcat on October 26, 2014, 06:05:57 06:05
See these links
http://catcatcat.d-lan.dp.ua/skachat/biblioteki/graficheskaya-biblioteka-dlya-drayvera-ssd1306/
http://catcatcat.d-lan.dp.ua/skachat/biblioteki/biblioteka-dlya-oled-drayvera-ssd1306-interfeys-i2c/
http://catcatcat.d-lan.dp.ua/skachat/biblioteki/biblioteka-dlya-oled-drayvera-ssd1306-interfeys-6800-parallelnyiy/


Title: Re: Libraries
Post by: lcn on October 27, 2014, 01:14:31 13:14
Thanks CATCAT

I try to build a lab board in order to connect an OLED screen inspired from schematic.
I can't find any components supplier that sells inductor  L1 : 2.2 - 47 uH

What is the brand of the part "DE070x" ?
Can you tell me where your order that part ?

The datasheet suggests to use one of the following, but Farnell and Radiospare do not have those in stock either :

for TPS61040 :
10 mH Sumida CR32-100
10 mH Sumida CDRH3D16-100
10 mH Murata LQH4C100K04
4.7 mH Sumida CDRH3D16-4R7
4.7 mH Murata LQH3C4R7M24



Title: Re: Libraries
Post by: Catcatcat on October 28, 2014, 05:23:27 05:23
may use any inductor and any upconverter. One condition that would have been required on the output voltage.


Title: Re: Libraries
Post by: lcn on November 07, 2014, 05:16:59 17:16
Hello Catcatcat

I've received my SSD1306 OLED 0.96" screens.  :)

I try to adapt your I2C library to work in SPI 4 wires mode ( DC, CS, MOSI, SCK )

I'm able to display demo characters on the screen but i have a  question please :

In this line, why X argument,  that is used for setting X position is negative : -1 ?
Code:
String_OLED("catcatcat.d-lan.dp.ua",0,0,0,-1,1);


Title: Re: Libraries
Post by: Catcatcat on November 09, 2014, 06:15:14 06:15
hi, if the argument is negative, the function is activated alignment line on the middle of the screen. This is convenient when you need to display a character string exactly in the middle of the display (without calculation beginning on X).


Title: Re: Libraries
Post by: lcn on November 09, 2014, 02:01:55 14:01
I found that when using larger character size, argument -1 does not align the string properly on the screen
Code:
String_OLED("OLED Display",0,4,4,-1,2);

However it works properly when i use width and height = 0

It looks that '-1' argument does not work with symbol_OLED function, do you confirm '-1' only work with strings ?

--

I did not understand what is the purpose of ticker_OLED and tickerB_OLED, i do not know how they work
Can you explain me please ?

--

How could i scroll a string horizontaly, is there a function to do that ?

--

I do not find rectangle, line, point function in your I2C library, they only exist in 8080G,
I tried to adapt them for SPI 4 wires use, but i did not success, the following defines get troubles and compiler don't want them :

Code:
#define bitset (var, bitno) ((var) |= 1 << (bitno));           // set
#define bitclr (var, bitno) ((var) &= ~ (1 << (bitno)));       // reset


Title: Re: Libraries
Post by: Catcatcat on November 10, 2014, 05:54:49 17:54
Quote
I did not understand what is the purpose of ticker_OLED and tickerB_OLED, i do not know how they work
Can you explain me please ?
only for character strings

Quote
I did not understand what is the purpose of ticker_OLED and tickerB_OLED, i do not know how they work
Can you explain me please ?
it "tickers".
ticker_OLED - designed to output strings stored in the program memory type const
tickerB_OLED - to output a character array formed in memory


Title: Re: Libraries
Post by: lcn on November 10, 2014, 06:04:27 18:04
Thanks,

How could i scroll a string horizontaly, is there a function to do that ?
something like this : http://www.youtube.com/watch?v=7-yIYsKFQ1Y


Title: Re: Libraries
Post by: lcn on November 10, 2014, 09:34:31 21:34
Did you implement point, rectangle, line, strip into IC2 library ?

I would like to port these functions to get them working in SPI 4 wires mode but i can't find them in your I2C project file.

Many thanks,


Title: Re: Libraries
Post by: Catcatcat on November 11, 2014, 03:18:51 03:18
Thanks,

How could i scroll a string horizontaly, is there a function to do that ?
something like this : http://www.youtube.com/watch?v=7-yIYsKFQ1Y

Yes!


Title: Re: Libraries
Post by: lcn on November 11, 2014, 01:48:48 13:48
Can you show me the code that scrolls a text in your library ?


Title: Re: Libraries
Post by: Catcatcat on November 12, 2014, 03:43:20 03:43
Code:
void OledTicker (const char *str,char dlinok,char start,char Y)
{
char a,b,X;
char dlinst=0; // length of the string in characters (6 columns)
// poz - position running line (external variable)
char colcim; // the number of output symbols
int ptr=0,sim; // initialize the pointer

// calculation of the string length
    while (str[dlinst++] != 0); // length of string

// calculation of output line length for 1 once
    if (dlinst>dlinok)//lines for large size of the output window
    {
            if (poz<dlinok){ptr=0; colcim=poz; X=start+(dlinok-poz)*6;}
            else
            if (poz<dlinst){ptr=poz-dlinok; colcim=dlinok; X=start;}
            else
            {ptr=dlinst-dlinok+(poz-dlinst); colcim=dlinok-(poz-dlinst+1); X=start;}
    }
    else//lines for the equal and less than the size of the output window
    {
            if  (poz<dlinst){ptr=0; colcim=poz; X=start+(dlinok-poz)*6;}
            else
            if  (poz<dlinok){ptr=0; colcim=dlinst-1; X=start+(dlinok-poz)*6;}
            else
            {ptr=dlinst-dlinok+(poz-dlinst); colcim=dlinok-(poz-dlinst+1); X=start;}
    }
// Position correction output start line
        i2c_start(ADRESOLED,0);     //
        i2c_write(0b00000000);      // control byte transfer commands
        i2c_write(0b10110000 | Y); // installation page
        i2c_write(X & 0b00001111); // setting column
        i2c_write((X >> 4) | 0b00010000); //
        i2c_stop(); //

    for (b=0;b<colcim;b++) // cycle of output symbols
    {
        sim=(str[ptr+b]-0x20)*5; // converting the character code in the position of CG
// Read byte to byte pattern symbol and displays
        i2c_start(ADRESOLED,0);     //
        i2c_write(0b01000000);      // control byte data transfer
        for (a=0;a<5;a++) i2c_write(SHRIFT[sim+a]);
        i2c_write(0);
        i2c_stop();
    }
    if (poz>=dlinst)
    {
        i2c_start(ADRESOLED,0);     //
        i2c_write(0b01000000);      // control byte data transfer
        for (a=0;a<5;a++) i2c_write(0);
        i2c_write(0);
        i2c_stop();
    }
    poz++;
    if (dlinst==(poz-dlinok)) poz=0; // when the pointer reaches (poz-dlinok) set to zero
}//


Title: Re: Libraries
Post by: lcn on November 12, 2014, 06:36:25 06:36
Thank you.

Did you implement geometry stuff such as : point, rectangle, line, strip into your IC2 library ?


Title: Re: Libraries
Post by: Catcatcat on November 12, 2014, 05:50:27 17:50
this is only a parallel interface, where it is possible not only to record but also to read data from the display memory.


Title: Re: Libraries
Post by: lcn on December 10, 2014, 06:32:14 18:32
Hello Catcatcat, all

Can you show me how to use ' ticker_OLED' and 'tickerB_OLED' functions with your OLED library, because it does not work for me :

I tried the following, but nothing is displayed on the screen :

Code:
        tickerB_OLED (20,5,0);
        ticker_OLED ("H",5,5,2);

I do not understand the functions arguments meaning because it is written in Russian.
Many thanks,



Title: Re: Libraries
Post by: lcn on December 27, 2014, 02:25:33 14:25
Hello

I need to create a custom character that will be 10x14 pixel size .

Can you tell me what software you have used to generate your 7x5 fonts ?

How can i generate a C code for my 10x14 custom character ?
I have made a monochrome BMP file so far, can you help for next steps please ?


Title: Re: Libraries
Post by: BharatSujanani on December 29, 2014, 07:02:31 07:02
HI
You can use LCD font maker for make fonts of size you want. I have software LCD Font Maker 3.92 is available but for limited time use not cracked version. If you need it inform me.


Title: Re: Libraries
Post by: lcn on December 29, 2014, 07:16:11 07:16
Hello

Yes, i'm interrested in getting LCD Font maker.

I've sent to you a PM with my email address

Many thanks


Title: Re: Libraries
Post by: BharatSujanani on December 29, 2014, 09:28:24 09:28
Hi
I have uploaded LCD Font Maker 3.92.exe on below link.
http://www.4shared.com/file/BBg_5VRVce/LCD_Font_Maker_392.html
Please download it.
I have not permanent version for this software.