Driver for ILI9341


Yesterday 18:52
Forum: The Lounge
Starter: Tim
Views: 0
Replies: 22
Yesterday 15:20
Forum: Proton Studio
Starter: johngb
Views: 0
Replies: 0
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Driver for ILI9341314 days old

  1. #1
    Junior Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    69
    Thumbs Up
    Received: 11
    Given: 9
    Total Downloaded
    2.34 GB

    2 Not allowed!

    Default Driver for ILI9341

    This is a simple driver for ILI9341 that prints charactes, lines and boxes. It was originally based on the driver that I extracted from Normnets Pic wav Player v1.0 for Nokia 6100 display which in turn I believe to be based on a driver by James Lynch which I also refered to. I addition to tha I have got some bits and pieces from all over the internet, not the least the Arduino crowd. <br>

    To use this driver you type:
    Include "ILI9341.inc"

    InitILI
    The init routine is in contrast with other inits I have seen very simple, its only starts the display but doesn't tweek any of its settings. My ILI9341 displays starts in BGR mode and mirrored. To fix that you have to set MADCTL register. There are four macros that set screen orientation, size of screen, color order to RGB and printing from left to right.


    SCRorientation0
    SCRorientation90
    SCRorientation180
    SCRorientation270

    There are few "graphic" commands that do what their names imply:

    ClearScreen
    SetPixel(x,y)
    HLine(x,y,w)
    VLine(x,y,h)
    XBlock(x,y,w,h)
    XBox(x,y,w,h)

    Printing of strings

    Fonts used are as defined in AN1182 by Microchip. To make fonts I used Microchip Graphics Resource Converter which is burried deep in Microchip Libraries for Applications. It takes Windows fonts and converts to horizontally arranged bitmaps, which isconvenient for this display. I manually converted these to basic using search and replace in Notepad++. There are several fonts includes in the zip.

    To use a font type for example:

    SetFont

    To print a string you must first set coordinates wXstart and wYstart and then:

    PrintString(string) or PrintString_At(x,y,string) which sets the coordinates first. Both call Sub Print_Chr which increments wXstart by the width of the character. More information on this can be gained by reading the program listing as I believe it to be reasonably commented.

    In the demo program there are some helper routines to set margins and print out whole fonts. It doesn't do much more than that. I will in following days post some more information on this driver and answear questions. I hope there will be some. The driver has some limitations, most notably it's inability to print wery lage fonts. I also hope to do some improvements in the coding.
    Attached Files Attached Files
    Last edited by John Drew; 15th October 2018 at 07:44. Reason: Removed the HTML
    Flosi Guđmundsson
    Reykjavík

  2. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Junior Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    69
    Thumbs Up
    Received: 11
    Given: 9
    Total Downloaded
    2.34 GB

    0 Not allowed!

    Default Re: Driver for ILI9312

    Few useful links:

    ILI9341 datasheet:
    https://courses.cs.washington.edu/co...l3/ILI9341.pdf

    Nokia 6100 LCD Display Driver:
    https://elecfreaks.com/estore/downlo...lay_Driver.pdf

    AN1182Fonts in the Microchip Graphics Library:
    http://ww1.microchip.com/downloads/e...tes/01182a.pdf

    Microchip Libraries for Applications:
    https://www.microchip.com/mplab/micr...r-applications
    Flosi Guđmundsson
    Reykjavík

  4. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Junior Member Andriy76's Avatar
    Join Date
    Dec 2018
    Posts
    2
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Driver for ILI9341

    Thanks so much. I am not a big expert and tried to remake the ILI9320 driver earlier . Which is here in the examples . The problem was the output of characters . And I could not overcome it .

  6. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Junior Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    69
    Thumbs Up
    Received: 11
    Given: 9
    Total Downloaded
    2.34 GB

    0 Not allowed!

    Default Re: Driver for ILI9341

    There are several displays that this driver would work with with small modifications. I don now about ILI9320 though. I wrote it originally for Nokia 6100 display, then changed it for ILI6193 which is often sold as St7335, and then for ili9341.
    Flosi Guđmundsson
    Reykjavík

  8. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,283
    Thumbs Up
    Received: 380
    Given: 137
    Total Downloaded
    1.59 GB

    0 Not allowed!

    Default Re: Driver for ILI9341

    Many thanks Flosi.

    A nice, well laid out piece of coding. I can see by your code format, you are going to love the Procedures for the 8-bit compiler. :-)

  10. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Junior Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    69
    Thumbs Up
    Received: 11
    Given: 9
    Total Downloaded
    2.34 GB

    0 Not allowed!

    Default Re: Driver for ILI9341

    Yea maybe. I asked for procedures 20 years ago and you said it would never happen. The compiler has now reached the point that I can do anything I want in a way that I like. I look forward to the time when unused subs don't add code. Will the procedures have any overhead?

    Anyway when procedures have been added isn't it high time for version four? I haven't paid for upgrades in 15 years.
    Flosi Guđmundsson
    Reykjavík

  12. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,283
    Thumbs Up
    Received: 380
    Given: 137
    Total Downloaded
    1.59 GB

    0 Not allowed!

    Default Re: Driver for ILI9341

    The procedures themselves have no overhead, if they are not used.

    If they are not used in a program, they are not placed in the program. The parameters are variables that are loaded that have a specific name attached to the procedure, the same for their returns. There is no pushing or popping for parameters, so they operate extremely efficiently.

  14. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    Junior Member Andriy76's Avatar
    Join Date
    Dec 2018
    Posts
    2
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Driver for ILI9341

    Hi. Somehow there is no file Include "18f26k2264MHz.inc." I try to use PIC18F452 . But ILI9341 doesn't work . Won't even init the display .

  16. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #9
    Junior Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    69
    Thumbs Up
    Received: 11
    Given: 9
    Total Downloaded
    2.34 GB

    0 Not allowed!

    Default Re: Driver for ILI9341

    Sorry about that. Here it is. You could use any setup that works. This uses intosc and PLL and runs at 64MHz.
    Flosi Guđmundsson
    Reykjavík

  18. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #10
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,293
    Thumbs Up
    Received: 79
    Given: 39
    Total Downloaded
    3.36 GB

    0 Not allowed!

    Default Re: Driver for ILI9341

    Is this any good? I use it with my preferred device of 18F26K22
    Config_Start FOSC = INTIO67 ;Internal oscillator block, port function on RA6 and RA7
    PLLCFG = On ;Oscillator multiplied by 4
    PRICLKEN = On ;Primary clock is always enabled
    FCMEN = OFF ;Fail-Safe Clock Monitor disabled
    IESO = OFF ;Oscillator Switchover mode disabled
    PWRTEN = OFF ;Power up timer disabled
    BOREN = OFF ;Brown-out Reset disabled in hardware and software
    BORV = 285 ;VBOR set to 2.85 V nominal
    WDTEN = On ;Watch dog timer enabled
    WDTPS = 2048 ;this value gives about 6 seconds before watchdog resets the chip
    PBADEN = OFF ;Segments<5:0> pins are configured as digital I/O on Reset
    HFOFST = OFF ;HFINTOSC output and ready status are delayed by the oscillator stable status
    MCLRE = EXTMCLR ;MCLR pin enabled, RE3 input pin disabled
    STVREN = On ;Stack full/underflow will cause Reset
    LVP = OFF ;Single-Supply ICSP disabled
    XINST = OFF ;Instruction set extension and Indexed mode disabled (Legacy mode)
    Debug = OFF ;Disabled
    Cp0 = OFF ;Block 0 (000800-001FFFh) not code-protected
    Config_End


    ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    OSCCON = %01110000 ;16MHz internal oscillator block
    Nop
    OSCCON2 = %10001100
    Nop
    Set OSCTUNE.6 ;enable PLL so clock now 64MHz - hold onto your hat Mother!

    ANSELA = %00000000 ;
    ANSELB = %00000000 ;beware - pic starts life with all analogue channels set to analogue
    ANSELC = %00000000

  20. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. [SOLVED !] driver for usb18f2550
    By Zeiger08 in forum USB Module
    Replies: 4
    Last Post: 23rd May 2015, 14:45
  2. Stepper driver
    By pic-ignorant in forum The Lounge
    Replies: 11
    Last Post: 25th April 2013, 21:10
  3. 0 to 10 v driver
    By Tim in forum The Lounge
    Replies: 25
    Last Post: 23rd July 2012, 10:29
  4. Bridge Driver
    By fanie in forum The Lounge
    Replies: 0
    Last Post: 27th August 2008, 12:55
  5. LM032LN Driver??
    By Darlington in forum The Lounge
    Replies: 0
    Last Post: 30th March 2008, 16:42

Members who have read this thread : 144

Actions :  (Set Date)

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts