Announcement

Collapse
No announcement yet.

Question about ViSi generated code for Flash based GCF images, fonts, strings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about ViSi generated code for Flash based GCF images, fonts, strings

    Hello All,

    The ViSi compiler generates the following commented code.
    - In which case exactly this code is used ?
    - Is there an example somewhere (Application note or forum ?)
    - What are the PA pins (Enable, SCK,SDO,SDI) for SPI1 ?
    Thanks in advance for your answers.
    Best regards,
    dpann

    // Uncomment the following if Flash and Flash based GCF images, fonts or strings used.
    /*
    // if SPI0 (Traditional uSD SPI port) Used
    // spi_Init(SPI_FAST, 0 or xSPI_ADDRESS_MODE4x ); // use SPI_ADDRESS_MODE4 if Flash memory is >16MB
    // if SPI1 (other SPI pins) Used
    // pin_HI(EnablePin) ; // EnablePin is PA pin connected to SPI_CS
    // pin_Set(PIN_OUT,EnablePin) ; // EnablePin is PA pin connected to SPI_CS
    // SPI1_SCK_pin(FlashSCK?<) ; // FlashSCK is PA pin connected to SPI_SCK
    // SPI1_SDI_pin(FlashSDI?<) ; // FlashSDI is PA pin connected to SPI_SDI
    // SPI1_SDO_pin(FlashSDO?<) ; // FlashSDO is PA pin connected to SPI_SDO
    // SPI1_Init(SPI_SPEED15, SPI8_MODE_5 x+ SPI_ADDRESS_MODE4x, EnablePin) ; // add SPI_ADDRESS_MODE4 if Flash memory is >16MB, EnablePin is USD_ENABLE or PA?
    spiflash_SetAdd(SPI0, 0, 0);
    hndl := spiflash_LoadGCFImageControl(SPIx, EnablePin); // SPIx is SPI0 or SPI1, as appropriate, EnablePin is USD_ENABLE or PA?
    */

  • #2
    Hello,

    SPI is an alternate method of communication you can use in 4D Systems devices.

    In order to use this SPI interface with a Diablo, you have to change the file system in the 'Project' tab in Workshop4 to flash like so:


    Click image for larger version  Name:	image_2020_11_16T00_10_27_937Z.png Views:	1 Size:	6.7 KB ID:	74302
    Click image for larger version  Name:	Screenshot 2020-11-19 101709.png Views:	1 Size:	77.1 KB ID:	74303

    Here you can select GCI Flash File Storage and which pins you will use for the SPI bus.

    After this is complete, you can comment out the code scaffold and adjust them according to what you have set in the options above.

    I have attached a sample project that uses the SPI interface for a demo program, keep in mind this demo project is for the 4Discovery 5.0 which has a built-in SPI flash chip that connects to the pins outlined above.

    If you would like to know about the SPI functions, I recommend you look at the Diablo16 Internal Functions Reference Manual. Look under the SPI Control and SPI flash functions sections to get an understanding of how it works.

    Hopefully this information should help,
    Adem
    Last edited by ademdeojee; 1 week ago.

    Comment

    Working...
    X