PEmicro Blog

Launch Cyclone Programming Via The 10-pin Control Port (With a Raspberry Pi Example)

Jan 19, 2022

PEmicro Cyclones feature "Cyclone Programming Control Port" functionality via the 10-pin expansion I/O interface on the Cyclone, which allows external signal control of programming operations. The Cyclone Programming Control Port may be used to launch programming as well as read the IDLE/BUSY state of the cyclone and the SUCCESS/ERROR result of the last programming operation. The port I/O operates from 1.6v-5.5v. These signals can be interfaced to by ATE (Automated Test Equipment), external buttons / LEDs, microcontrollers, etc. 

A Raspberry Pi control example, as well as a simple button/LED control example, are shown below.  

Note that using the Programming Control Port is just one of many ways to control programming of the Cyclone, which include: 

  • Using the Control SDK via USB, Serial, or Ethernet
  • Using the Control Console application via USB, Serial, or Ethernet
  • Using the Start Button (Rated to 1M+ presses)
  • Using the Touch Screen Display
  • Using the Programming Control Port 

Programming Control Port – Pinout and Definition

The Programming Control Port pinout is shown here. To align Pin 1 with the Cyclone port, rotate 90 degrees clockwise: 

The functionality of each signal is described here : 

Pin #
Signal Name
Description
1
PWR_5V_OUT
The Cyclone can provide a constant 5V, 100mA output on this pin which may be used to power external circuitry.
2
GND
Should be connected to the GND of any controlling circuitry.
3
VCCIO_IN
This voltage is used to drive the output pins of the programming control port and is used as a reference for the input pins. This voltage can be from 1.6v-5.5v. This pin may be directly connected to the PWR_5V_OUT output pin of the Programming Control Port, if 5v operation of the port is desired. This signal has an internal 100K Ohm pullup resistor and a 470 Ohm series resistor.
4
CPORT_IN1
Falling edge sensitive pin which will clear the status (Success or Error) LED of the Cyclone (if ~SENSE_IN is low and triggering is enabled with the "controlporttriggerenable" property in the Cyclone). This signal has an internal 100K Ohm pullup resistor and a 470 Ohm series resistor.
5
EXTRA_IN2
Currently unused.
6
~START_IN
Falling edge sensitive pin which will launch programming of the currently selected image on the Cyclone (if ~SENSE_IN is low and triggering is enabled with the "controlporttriggerenable" property in the Cyclone). This signal has an internal 100K Ohm pullup resistor and a 470 Ohm series resistor.
7
~SUCCESS_OUT
A low value indicates the most recent programming operation was successful. A high value means that there is no success to report (programming is ongoing, an error occurred, no programming launch has occurred, too much time has passed since the last programming operation, etc). This signal has an internal 100K Ohm pullup resistor and a 470 Ohm series resistor.
8
~ERROR_OUT
A low value indicates the most recent programming operation failed. A high value means that there is no error to report (programming is ongoing, programming was successful, no programming launch has occurred, too much time has passed since the last programming operation, etc). This signal has an internal 100K Ohm pullup resistor and a 470 Ohm series resistor.
9
~IDLE_OUT
A low indicates the Cyclone is IDLE and can accept a programming launch operation. A high indicates the Cyclone is currently running a programming operation. This signal has an internal 100K Ohm pullup resistor and a 470 Ohm series resistor.
10
~SENSE_IN
An input which must be driven low to enable the programming control port inputs. This signal has an internal 100K Ohm pullup resistor and a 470 Ohm series resistor.

Powering the Programming Control Port

To allow the Cyclone to drive the port outputs to show the current programming state, and to allow the Cyclone to properly interpret input signals on the port, the Programming Control Port I/O voltage must be set. This is done by connecting an external voltage of 1.6v-5.5v to the VCCIO_IN pin of the port. This VCCIO_IN pin may be directly connected to the PWR_5V_OUT output pin of the Programming Control Port if 5v operation of the port is desired. If connecting to external circuitry which runs at a different voltage, such a 3v, simply connect the desired voltage to the VCCIO_IN pin. 

Once powered, the outputs (~SUCCESS_OUT, ~ERROR_OUT, and ~IDLE_OUT) become actively driven.

Enabling Triggering on the Programming Control Port

The Programming Control Port allows programming to be launched from the Programming Control Port. For this to happen, the triggering must previously have been enabled in the settings of the Cyclone (see below) and the port must be detected as active. 

The Programming Control Port is considered active if there is an appropriate voltage applied to the VCCIO_IN pin and the ~SENSE_IN signal is driven low.

To enable trigger in the settings of the Cyclone, the “controlporttriggerenable” property in the Cyclone must have been enabled at some point (this setting is stored in the Cyclone once set). This can be done via the Cyclone Control SDK, Cyclone Control Console, or Cyclone Control GUI.

For the Cyclone Control Console, an example command which reads this property for a Cyclone named “Universal_PEM0927F6” is (all in a single line):

cycloneControlConsole  -cyclone=Universal_PEM0927F6  -getproperty=hardwareproperties,0,controlporttriggerenable

For the Cyclone Control Console, an example command which sets this property for a Cyclone named “Universal_PEM0927F6” is:

cycloneControlConsole  -cyclone=Universal_PEM0927F6  -setproperty=hardwareproperties,0,controlporttriggerenable,1

In the Cyclone Control GUI, this property may be accessed by opening the Cyclone and choosing the “Properties” tab:

To set the property, highlight it and click the … button on that line. Enter the value 1 to enable and 0 to disable triggering

 The triggering should then show as active (note that ~SENSE_IN will also need to be driven low for triggering to work):

Timing on the Programmming Control Port

In its default idle state, the Cyclone will drive the ~IDLE_OUT signal low. When a falling edge is detected on the ~START_IN signal, the ~SUCCESS_OUT and ~ERROR_OUT signals will be driven high and then the ~IDLE_OUT signal will be driven high (BUSY). Once programming is complete, the ~SUCCESS_OUT and ~ERROR_OUT signals will be driven to reflect the result of programming and then the ~IDLE_OUT signal will be driven back low. 

The following mechanisms describe ways in which intelligent control circuitry, such as ATE systems, can interact with the Cyclone Programming Control Port to control the programming process.

A mechanism to launch programming on the Cyclone if controlled by edge sensitive control equipment:

  1. Wait for ~IDLE_OUT to be low
  2. Enable negative edge detection on ~IDLE_OUT input
  3. Drive the ~START_IN signal low then back high (this edge is detected in HW on the Cyclone and won’t be missed)
  4. Wait for the negative edge on ~IDLE_OUT (i.e. wait for the Cyclone to go to BUSY then IDLE)
  5. Read the ~SUCCESS_OUT and ~ERROR_OUT signals to determine result

A mechanism to launch programming on the Cyclone without using edge sensitive control equipment  (polled method):

  1. Wait for ~IDLE_OUT to be low
  2. Drive the ~START_IN signal low then back high (this edge is detected in HW on the Cyclone and won’t be missed)
  3. Wait 100mS for the Cyclone to recognize the ~START_IN falling edge and to set the ~IDLE_OUT signal
  4. Wait for ~IDLE_OUT to go low
  5. Read the ~SUCCESS_OUT and ~ERROR_OUT signals to determine result

Push Button / LED Example Circuit

This following example circuit has a push button that triggers programming. The three LEDs show the Success, Failure, and Idle/Busy lines. 

After setting up the above connections, pushing the button will trigger programming and the Cyclone state can be seen on the LEDs. 

Raspberry Pi Example 

This example uses a Raspberry Pi to launch programming, wait for programming completion, and then display a string indicating success or failure of the operation. 

A Raspberry Pi 4 Model B, monitor, keyboard, mouse and wire connectors are needed for the example. Set up the Raspberry Pi and connect it to monitor, keyboard and mouse. It should also be connected to the Programming Control Port in this way:

ControlPort
Raspberry Pi
VCCIO IN(Pin3)3V3(Pin1)
GND(Pin2)GND(Pin6)
SENSE IN(Pin10)GND(Pin9)
START IN(Pin6)GPIO 18(Pin12)
SUCCESS OUT(Pin7)GPIO 14(Pin8)
ERROR OUT(Pin8)GPIO 15(Pin10)

IDLE OUT(Pin9)

GPIO 17(Pin11)

Running the following Python application on the Raspberry Pi will trigger programming, wait for the programming to complete, and then read and display whether the programming was successful or a failure. 

import RPi.GPIO as GPIO 
import time

SuccessPin = 8
ErrorPin = 10
IdlePin = 11
StartPin = 12

GPIO.setwarnings(False) 
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
GPIO.setup(SuccessPin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) 
GPIO.setup(ErrorPin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) 
GPIO.setup(IdlePin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(StartPin, GPIO.OUT, initial=1) 

if GPIO.input(IdlePin) == 0:  
    GPIO.add_event_detect(IdlePin, GPIO.FALLING)
    print ("Executing...")
    GPIO.output(StartPin, 0) #trigger programming
    GPIO.output(StartPin, 1) 
    while not (GPIO.event_detected(IdlePin)):
        time.sleep(0.01)       
    if GPIO.input(SuccessPin) == 0:
        print("Success")
    elif GPIO.input(ErrorPin) == 0:
        print("Error")
    else:
        print("Unable to read programming result")
else:
    print ("Cyclone is Busy. Programming not launched.")


GPIO.cleanup() 

Tags related to this Blog Post

Cyclone     Cyclone FX     ARM     NXP     Production Programming     Automated Control