Menu

Ili9341 read pixel

2020-01-14
2020-01-16
  • stan cartwright

    stan cartwright - 2020-01-14

    I dug out an ili9341 connected to a 18f25k22 running at 3V.
    I powered it up and flashed the ili9341 demo which worked fine.
    So I changed the ili9341 read pixel demo from uno to pic...but it didn't work.
    I should/could try a uno but then I noticed that uncommenting #define ILI9341_hardwarespi stopped the demo working, I'll dig out the pins for 18f25k22

    '''A demonstration program for GCGB and GCB.
    '''--------------------------------------------------------------------------------------------------------------------------------
    '''This program is a simple GLCD demonstration of the ILI9341 GLCD capabilities.
    '''It is a nice graphical LCD, suitable for a lot of various projects.
    '''This program draws lines, boxes, circles and prints strings and numbers.
    '''The GLCD is connected to the microprocessor as shown in the hardware section of this code.
    ''':
    '''This has been tested using the hardware SPI option.
    ''':
    ''':
    '''@author  EvanV
    '''@licence GPL
    '''@version 1.0
    '''@date    14/06/17
    '''********************************************************************************
    
      'Chip Settings
        #chip 18f25k22,64
        #config MCLRE=on
        #option Explicit
        #include <glcd.h>
    
        #define GLCD_TYPE GLCD_TYPE_ILI9341
    
        'Pin mappings for ILI9341
        #define GLCD_DC portc.2
        #define GLCD_CS portc.0
        #define GLCD_RESET portc.1
    
        'As we are using Harware SPI this cannot be change on this chip. This is a non-PPS chip.
        #define GLCD_DI portb.2
        #define GLCD_DO portb.3
        #define GLCD_SCK portb.1
    ;    #define ILI9341_hardwarespi
    
     
  • stan cartwright

    stan cartwright - 2020-01-15

    Well the ili9341 demo works with no hardware spi but the read pixel didn't.
    What 18f25k22 pins are used for hardware spi to ili9341? PLEASE!
    http://ww1.microchip.com/downloads/en/DeviceDoc/40001412G.pdf
    is so vague. I'm using a 28 pin dil chip.
    It's just five wires.

     
  • Trev

    Trev - 2020-01-15

    I'm not sure why you think it is vague Stan. There is a table starting on p 15 headed "PIC18(L)F2XK22 PINOUT DESCRIPTIONS" which describes every pin and there is a column headed "PDIP, SOIC" which applies to your PDIP 18F25K22 chip.

     
  • stan cartwright

    stan cartwright - 2020-01-15

    I find pics difficult, I changed two pins to what I think is hardware but not working at all now.

     
  • stan cartwright

    stan cartwright - 2020-01-15

    This table Trev ?
    clk,mosi,miso is what I chose? Are the other cs and dc relevent?
    Don't do this with a uno/nano so thick.

     
  • stan cartwright

    stan cartwright - 2020-01-15

    This would have nothing with the pic running at 3.3V would it? The software spi works surprisingly well.

        #define GLCD_DC portc.2
        #define GLCD_CS portc.0
        #define GLCD_RESET portc.1
    
        'As we are using Harware SPI this cannot be change on this chip. This is a non-PPS chip.
        #define GLCD_DI portb.2
        #define GLCD_DO portb.3
        #define GLCD_SCK portb.1
    ;    #define ILI9341_hardwarespi
    

    Do DC,CS,Reset need to be special pins?
    The other 3 should be the lowest number on this pic as it seems to have dual spi.
    An article in help about hardware spi .... and i2c would be handy ie explaining what pins needed are called.
    Given different names on a uno/nano ... but the board is labelled ie pins.
    Can't given my pic, someone say what's needed and make it permanent help somewhere?
    Please.
    Did I miss ili9341 hardware spi for pic in demos? I need new glasses.
    I dread using pps. I got a dev board that uses it.

    Using a pic at 3.3V does away with logic level converters which makes bread board look like birds nest.

     
  • Trev

    Trev - 2020-01-16

    There's an example in Great-Cow-BASIC-Demonstration-Sources/Vendor_Boards/Great_Cow_Basic_Demo_Board/18F25K42_ChipRange_Demonstrations/340_SPI_GLCD_with_Touch_using_ili9341.gcb

    It looks a little different to your pin assignments, but I haven't checked for any pinout differences between the K22 and K42 chips.

     
  • stan cartwright

    stan cartwright - 2020-01-16

    I never got touch to work on ili9341...It might not have the hardware installed on the board,just the pinouts.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.