Odyssey Personality - Dual Config FPGA LOAD and Dual Config PWM LEDs
WARNING: Dual Config FPGA LOAD can take 3 minutes to configure the FPGA!
This set of personalities is used to demonstrate the MAX 10 FPGA dual configuration capability. Dual Config FPGA LOAD includes a non-volatile loader which programs the MAX 10 FPGA so the configuration loads instantly at power on. Because the non-volatile loader takes a long time to run, a second personality, Dual Config PWM LEDs, is provided to control the FPGA after power-up, assuming the FPGA image was previously programmed with the non-volatile version of the Dual Config personality.
The two images loaded into the FPGA are slight variations of the PWM LEDs personality.
How To Use
First select the Dual Config FPGA LOAD personality. This personality will take about 3 minutes to program the Max10 flash memory with two configurations – each a version of PWM LEDs. Once loaded, the App page will allow control of the FPGA image by allowing different LED patterns to be displayed. You can now also power-cycle the device and the FPGA will immediately load with one of the two images.
When power is re-applied, the MAX 10 FPGA will read the status of the config select pin, which is connected to DIP Switch #4. Depending on the value of this switch, the Max 10 will load configuration image 1 or 2. Image 1 will load with outer LEDs flashing, and Image 2 will load with inner LEDs flashing.
When the board is power-cycled, the Bluetooth connection will have been lost, so you must go back in the App and re-select the device. To continue using the FPGA, you should now select the "Dual Config PWM LEDs" personality NOT the FPGA LOAD variant, so as to avoid the long programming time.
You can use the Config 1 and Config 2 buttons in the App to force the FPGA to load one of the two personalities. The images are identical except for the "flash" option, which will flash different LEDs. The LED control buttons in the App can be used to select different LED PWM patterns and options.
Each time the FPGA is configured or the power is applied, the board comes up in manual mode and can be controlled without the App:
Push button zero (PB0) will cycle through LED states: flashing, global level, or pattern. When in global level, push button one (PB1) will cycle through four levels of brightness (off, low, med, high).
The App control page also allows control of these functions, but once an LED button has been pressed, manual control via the pushbuttons is disabled until the next reconfiguration or power cycle. Buttons are all single-function.
How It Works
To get a full appreciation, first load the PWM LEDs personality, and explore the behavior of that load. Pay special attention to which LEDs flash when the "flash" option is selected. The PWM LEDs personality uses volatile loading – it just programs the SRAM configuration bits of the FPGA, and the image is lost when the power is removed.
The Dual Config FPGA LOAD personality, however, programs the Flash in the MAX 10 FPGA and also takes advantage of the MAX 10 FPGA's dual configuration capability.
The dual configuration behavior in the FPGA is perfect for "failsafe" field upgrades or for enabling multiple functions in a single chip. The MAX 10 FPGA contains more flash than is necessary to load just one FPGA image and thus the additional space can be used for a second image or even as user-controlled flash (for logs, soft processor code, tables, etc.). The chart below shows options and benefits:
The PWM (pulse width modulator) is a function well suited and easily implemented in FPGA logic. Since it's just a counter that controls the on time and off time of an I/O pin, you can create as many as you need in the MAX 10 FPGA logic fabric. Eight have been used to control the LEDs in this design, but they can also be used for functions such as motor control.
Like all controls from the phone app to the MAX 10 FPGA, commands are sent via I2C-compatible writes from the Broadcom BLE module.