PEmicro logo
Cart New Account Login

Logo image
HomeAbout usProductsSupportForumsBlogCustomer Service


by Laith Shamieh


PEmicro has added "Cyclone Programming Control Port" functionality to the 10-pin expansion I/O interface on the Cyclone allowing 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 NameDescription
1PWR_5V_OUTThe Cyclone provides a constant 5v output on this pin which may be used to power external circuitry.
2GNDShould be connected to the GND of any controlling circuitry.
3VCCIO_INThis 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
4EXTRA_IN2Currently unused.
5EXTRA_IN21Currently unused.
6~START_INFalling 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).
7~SUCCESS_OUTA low value indicates the most recent programming operation was successful. A high value means that there is no success to report (programming is on-going, an error occurred, no programming launch has occurred, too much time has passed since last programming operation, etc).
8~ERROR_OUTA low value indicates the most recent programming operation failed. A high value means that there is no error to report (programming is on-going, programming was successful, no programming launch has occurred, too much time has passed since last programming operation, etc).
9~IDLE_OUTA low indicates the Cyclone is IDLE and can accept a programming launch operation. A high indicates the Cyclone is currently running a programming operation.
10~SENSE_INAn input which must be driven low to enable the programming control port inputs.

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:

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 :

ControlPortRaspberry Pi

VCCIO IN(Pin3) 

GND(Pin2) 

SENSE IN(Pin10) 

START IN(Pin6) 

SUCCESS OUT(Pin7) 

ERROR OUT(Pin8) 

IDLE OUT(Pin9)

3V3(Pin1) 

GND(Pin6) 

GND(Pin9) 

GPIO 18(Pin12) 

GPIO 14(Pin8) 

GPIO 15(Pin10) 

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() 




search in blog posts

Tags

Product pages
Cyclone (101)
Cyclone FX (107)
Multilink (68)
Multilink FX (61)
GDB Server (31)
Prog ACMP (32)
Interface Library Routines (7)


Manufacturer
ARM (88)
NXP (89)
Microchip (7)
Cypress (7)
Infineon (7)
Maxim (3)
Nordic Semiconductor (3)
Silergy Teridian (1)
Silicon Labs (6)
STMicroelectronics (12)
Texas Instruments (2)
Toshiba (3)
Renesas (15)


Categories
Production Programming (108)
Debug (66)
Automated Control (29)
Miscellaneous (40)



© 2022 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement