Menu

impossible to compile ILI9341 for arduino mega + shield

Help
Angel GM
2018-06-11
2018-07-24
  • Angel GM

    Angel GM - 2018-06-11

    Hello everyone
    The first thing is to apologize for using Google translator given my low level of English.
    I try to compile a simple and simple example with atmega2560 + shield TFT320QDT_9341 and until now I have not had form.
    I have compiled the same example in its version 18F2520 and 18F4680 for our own consoles and everything is perfect.
    With Atmega2560 + shield it is impossible. I think I've tried everything: map by "digital" or access the port directly. The result is negative.


    Version:
    GCBasic: 0.98.0.2
    Windows

    #chip mega2560,16
    #option explicit
    #include <glcd.h>
    '#include <mega2560.h>
    #define GLCD_TYPE GLCD_TYPE_ILI9341
    
      'Mapping with DIGITAL_xx you get the same result
    
    #define GLCD_DC G.2 'Data command line
    #define GLCD_CS G1 'Chip select line
    #define GLCD_D7 'Reset line
    #define GLCD_DI B.3 'Data in | MISO
    #define GLCD_DO B.2 'Data out | MOSI
    #define GLCD_SCK B.1 'Clock Line
    
      '#define ssd1289_HardwareSPI
    
      GLCDprint (1,1, "Hello")
    end
    

    Messages:

    WARNINGs / ERRORs reported by Great Cow BASIC (if Syntax Error, doubleclick on the error message below) <<<
    test_for_ILI9341.gcb (16): Error: Syntax Error
    Duration: 9.4 Seconds.


    Thanks for the attention and time provided

     

    Last edit: Anobium 2018-06-11
  • Anobium

    Anobium - 2018-06-11

    No problem,

    There are typos. I have guessed your ports, so please update as required. The port address was incorrect and GLCD_RESET was incorrrectly type.

    #define GLCD_DC     portG.2 'Data command line
    #define GLCD_CS     portG.1 'Chip select line
    #define GLCD_RESET  portg.3 'Reset line
    #define GLCD_DI     portB.3 'Data in | MISO
    #define GLCD_DO     portB.2 'Data out | MOSI
    #define GLCD_SCK    portB.1 'Clock Line
    

    No problem.

     

    Last edit: Anobium 2018-06-11
  • stan cartwright

    stan cartwright - 2018-06-11

    Can I mention #define GLCD_RESET is not needed from my use of ili9341 with gcb? it needs tieing high, .that includes anobium's read pixel for this display works to.
    Saves a pin. I've never used the ili9341 reset line with gcb.
    I've mentioned it...so too late.

     

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.