FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - LOstrander

Pages: [1]
1
Discussion - Software / Re: Using MM900EV-LITE as SPI Slave
« on: June 21, 2019, 05:25:45 PM »
At least part of my issue was solved: It looks like you can't have the programmer attached to CN5 if you have a SPI Slave on CN2.  I assume this has something to do with how the programmer uses the same pad.  I disconnected the programmer, and my CLK and MISO lines reappeared!

I still get a crash when I try to send certain things over SPI (might be the datatype I'm trying to send, since regular old numbers seem to work fine), and if I try to make the variables static it seems to complain, but it looks like the SPI problem is pretty much solved.

2
Discussion - Software / Re: Using MM900EV-LITE as SPI Slave
« on: June 21, 2019, 02:20:36 PM »
I've added the ft900_registers.h file to the project, and now it at least gets through the function and loads the next screen without crashing.

However, this has pointed out a new issue: It doesn't seem to actually be setting the SPI Slave pins as such.  Specifically, the CLK line seems to be convinced it's an output, and idles high at 3.3V.  The SS and MOSI lines appear to be working.  The MISO line is hard to tell because it requires the CLK line to work for it to work.  When my SPI Master is disconnected from the MM900EV-LITE, it functions perfectly (besides the MISO for obvious reasons).

Does anyone have a pinout of the CN2 connector that explicitly shows which pin is which number?  I'm 99% sure I'm right in assuming it's left column odd, right column even, but I want to rule that out.  The next pin down (Pad 66) is my "Go" signal, and it works perfectly.

3
Discussion - Software / Using MM900EV-LITE as SPI Slave
« on: June 20, 2019, 04:15:18 PM »
I have a touchscreen and controller that I'm using as an HMI in a larger system.  I want to use the MM900EV-LITE as a SPI Slave to send some data from the touchscreen to the main controller.  For some reason, whenever I try to write to the SPI_DATA register, the controller resets.

I'm using the exact same code as the example from the FT9xx Toolchain for a SPI Slave.

Code: [Select]
#include "GoButton.h"
#include "FT_Platform.h"
#include "FT_ESD.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ff.h"
#include "FT_Platform_FT900.h"

#ifndef ESD_SIMULATION
#include "ft900.h"
#include "ft900_spi.h"
#endif

ESD_FUNCTION(GoButton_SendData)
ESD_PARAMETER(fptr, Type = int)
void GoButton_SendData(fptr)
{
#ifndef ESD_SIMULATION
#define APP_BUFFER_SIZE (8)

#define SPIS_FIFOSIZE (64)

uint8_t* spis_dev_buffer;
uint8_t spis_dev_buffer_size;
uint8_t spis_dev_buffer_ptr;

    // Enable the SPI Slave device...
    sys_enable(sys_device_spi_slave0);

    // Set GPIO36 to SPIS0_CLK, GPIO37 to SPIS0_SS, GPIO38 to SPIS0_MOSI and GPIO39 to SPIS0_MISO...
    gpio_function(36, pad_spis0_clk);
    gpio_function(37, pad_spis0_ss);
    gpio_function(38, pad_spis0_mosi);
    gpio_function(39, pad_spis0_miso);

gpio_function(66, pad_gpio66);

    // Configure directions for the SPI slave 0 pins
    gpio_dir(36, pad_dir_input);
    gpio_dir(37, pad_dir_input);
    gpio_dir(38, pad_dir_input);
    gpio_dir(39, pad_dir_output);

gpio_dir(66, pad_dir_output);
gpio_pull(66, pad_pull_none);

    // Enable the SPI Slave Device...
    spi_init(
        SPIS0,          // Device
        spi_dir_slave,  // Direction
        spi_mode_0,     // SPI mode
        4);             // Ignored

    // Enable the FIFOs on the SPI Slave...
    spi_option(SPIS0, spi_option_fifo, 1);
spi_option(SPIS0,spi_option_fifo_size,SPIS_FIFOSIZE);
spi_option(SPIS0,spi_option_fifo_receive_trigger,1);

// Global variables initialization
//    spis_dev_buffer = buffer;
    spis_dev_buffer_size = APP_BUFFER_SIZE;
    spis_dev_buffer_ptr = 0;

    ...

//Setup data for transfer
uint8_t SendBuf[8] = {Diameter, Angle, Base >> 8, Base & 0xFF, Nose >> 8, Nose & 0xFF, Amount, Interval};
spis_dev_buffer = SendBuf;

//Load first byte
SPIS0->SPI_DATA = spis_dev_buffer[0];

//Tell the MCU to start transfering
gpio_write(66, 1);

//Wait for the Slave Select to go low
do{
asm_noop();
}
while(gpio_read(37) == true);

    // Load the SPIS0 buffer...
for(i=1;i<APP_BUFFER_SIZE;i++)
{
SPIS0->SPI_DATA = spis_dev_buffer[i];
}

//Make sure "Go button" is reset
gpio_write(66, 0);
#endif

}

From what I can tell, I'm not doing anything different besides leaving out the UART and looping functions from the example.  Is there something I missed?  or a file I need to include?

4
Discussion - Software / Re: Manipulating SD Files with ESD
« on: April 23, 2019, 06:02:49 PM »
I seem to have it working now.  It looks like the emulator's C compiler doesn't like me using the ff.h header in anything besides the ESD specific functions, but when I upload the program to my FT900, it works perfectly.

5
Discussion - Software / Manipulating SD Files with ESD
« on: April 22, 2019, 04:27:41 PM »
I have been trying to incorporate a couple of functions into my ESD program to read and write a few text files from an SD card.

First I tried using the fopen() functions native to C.  The program compiled and ran, but when I went to check the SD card's contents, the files were nowhere to be found.

Next I tired using the FatF header included in the SD card example in the Ft9XX Toolchain.  I changed the functions over to the FatF commands, and included all of the files required in my ESD project.

For some reason, however, it refuses to recognize the typedefs for the various functions within the header (specifically the DSTATUS and DRESULT types in diskio.h), and claims a few variables/enums were undeclared because of this.

So my question is kind of two-fold:  Is there an easy way to communicate with the SD card on the FT900 through ESD for non-bitmap files, and if it involves the ff.h header, what do I change to make it function?

For reference, I'm using the ME812A WH50R and MM900EV-LITE in ESD 4.5.

6
Discussion - Software / Re: A few questions about functions in ESD 4.5
« on: April 12, 2019, 09:52:32 PM »
I've been trying to incorporate the App_Keyboard code into my ESD file, but there seems to be a lot of differences in the Toolchain's Display Lists and those used by ESD.  Mostly I've found they're simply the Toolchain's functions/files with Ft_ placed in front, but there's one function in the example file I can't seem to find an ESD "alternative" for.  It's the App_Flush_Co_Buffer function called at the end of the Notepad() function.  What should I change that to so ESD recognizes it?

Thank you

7
Discussion - Software / Re: A few questions about functions in ESD 4.5
« on: April 09, 2019, 03:36:48 PM »

The 'Variable Update' sample included in ESD 4.5 may also0 be useful for you.

As for the keyboard example, I would suggest having a look at the display list included in this and copying this into your code.


I'm not really seeing anything related to a keyboard in the Variable Update example... (was there supposed to be an attachment?)


- You can implement the always running functions in the "update" slot of your screens. Else, if you need to call them once, put them in the start slot.
- Functions that don't interact with GUI are "useless" (let me say  ;) , I got your point) in this case. So can / must be in another place.

- Global variables, i'm sorry, I've done them the old way (editing code), so I can't help you.

Thank you!  I'll play around with these and see if I can get them working.

Semi-related note - can I throw text files from an SD card into the Resources folder to test accessing them?

8
Discussion - Software / A few questions about functions in ESD 4.5
« on: April 08, 2019, 07:51:43 PM »
I am trying to design a program in Eve Screen Designer 4.5 to act as the HMI for a larger machine.  In have the basic GUI laid out to where I can navigate screens and the like.  The issue I'm running into now is performing actions in the background based on user input.

I guess the main question I have is how the functions interact with the rest of the system "flow."  If they don't have a call, do they just run continuously on the page, or only when the page is first activated?  Can variables persist across several pages, or are they "destroyed" when you leave the page they were created in?

I've looked at some of the example programs, but I'm not exactly following what's going on in them.

There are 3 major things I'd like the HMI to do when commanded:

1. Keep track of what language was selected by the user and display the corresponding text on each page (i.e. HOME in English and ZUHAUSE in German).  Preferably based on which button was pressed on the User Settings page.

2. Display text based on the contents of a text file.  Essentially, each time the user presses a left or right arrow, display the correct string of text in a label on the screen.  (I have a fairly good understanding of how to implement this, but again, would like it to persist across several pages)

3. Send/Receive data over SPI and perform a couple of functions (namely sending the new program info to the other controller and displaying any error messages received from it).

One other minor question is implementing a keyboard on the screen.  I saw an example program for the FT900 toolchain that creates a keyboard.  Can this be used in ESD?  For example, if I put it in the same folder and #include it in the function file, can it be called and displayed in the program?

For reference, we are using the ME812A WH50R screen and the MM900EV-LITE board in this setup.

Pages: [1]