syso bio photo

syso

I make things.

Update: I am working on an in-system debugging board, which replaces a real P8X32A and allows in-system debugging with break points, stepping trough code etc. Feel free to leave suggestions in the comments box below or on Hackaday! I am also working on an BeMicro CV addon board for more useful applications.


Parallax has released the source code for the initial prototype version of the Parallax Propeller P8X3A, which is an 8-Core Microcontroller. Shortly I decided to give it a try on my BeMicro CV Board and make the on-board peripherals, such as SD-Card Socket, DIP-Switches and Push-Buttons work.

The first step was to grab the HDL from the Parallax website (see link above in the text) and unpack it. This gives us 3 directories - one for the BeMicroCV (which has basic functionality and wrongly assigned Core/Cog-Activity LEDs), one for an Altera DE0 board, which doesnt contain the Character ROM and one for an Altera DE2.

The BeMicroCV is capable for running the P8X32A at 80MHz with all features included inthe original Parallax Propeller 1 (including Video Generating, VGA and a lot more). Users have reported that they have already made modifications to the code to give an additional OUTB/DIRB register set, which allows to have 64 I/O pins instead of 32. The modifications also include the overclocking to up to 160MHz and stable results at 140MHz.

Modifying the Source HDL

Now back to my code modifications to make the On-Board SD-Card Socket, DIL-Switches and Buttons work. We have to change the top.qsf file to match with the following pin layout:

FPGA Pin Usage
All pins beginning with PIN_ are not allocated for the current design but used for other reasons, such as the SD-Card.

Use the following for top.qsf.

# -------------------------------------------------------------------------- #
#
# Copyright (C) 1991-2011 Altera Corporation
# Your use of Altera Corporation's design tools, logic functions 
# and other software and tools, and its AMPP partner logic 
# functions, and any output files from any of the foregoing 
# (including device programming or simulation files), and any 
# associated documentation or information are expressly subject 
# to the terms and conditions of the Altera Program License 
# Subscription Agreement, Altera MegaCore Function License 
# Agreement, or other applicable license agreement, including, 
# without limitation, that your use is for the sole purpose of 
# programming logic devices manufactured by Altera and sold by 
# Altera or its authorized distributors.  Please refer to the 
# applicable agreement for further details.
#
# -------------------------------------------------------------------------- #
#
# Quartus II 64-Bit
# Version 11.1 Build 259 01/25/2012 Service Pack 2 SJ Full Version
# Date created = 13:08:54  October 05, 2012
#
# -------------------------------------------------------------------------- #
#
# Notes:
#
# 1) The default values for assignments are stored in the file:
#		top_assignment_defaults.qdf
#    If this file doesn't exist, see file:
#		assignment_defaults.qdf
#
# 2) Altera recommends that you do not modify this file. This
#    file is updated automatically by the Quartus II software
#    and any changes you make may be lost or overwritten.
#
# -------------------------------------------------------------------------- #


set_global_assignment -name FAMILY "Cyclone V"
set_global_assignment -name DEVICE 5CEFA2F23I7
set_global_assignment -name TOP_LEVEL_ENTITY top
set_global_assignment -name ORIGINAL_QUARTUS_VERSION "11.1 SP2"
set_global_assignment -name PROJECT_CREATION_TIME_DATE "13:08:54  OCTOBER 05, 2012"
set_global_assignment -name LAST_QUARTUS_VERSION 14.0
set_global_assignment -name MIN_CORE_JUNCTION_TEMP "-40"
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 100
set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "3.3-V LVCMOS"


set_global_assignment -name VERILOG_INPUT_VERSION SYSTEMVERILOG_2005
set_global_assignment -name VERILOG_SHOW_LMF_MAPPING_MESSAGES OFF
set_global_assignment -name USE_CONFIGURATION_DEVICE OFF
set_global_assignment -name CRC_ERROR_OPEN_DRAIN OFF
set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -rise
set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -fall
set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -rise
set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -fall

set_global_assignment -name OPTIMIZE_HOLD_TIMING "ALL PATHS"
set_global_assignment -name OPTIMIZE_MULTI_CORNER_TIMING ON
set_global_assignment -name SEED 1

set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS ON
set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW"
set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)"
set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC OFF
set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING OFF
set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING OFF
set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION OFF
set_global_assignment -name CYCLONEII_OPTIMIZATION_TECHNIQUE BALANCED
set_global_assignment -name SYNTH_TIMING_DRIVEN_SYNTHESIS ON
set_global_assignment -name FITTER_EFFORT "AUTO FIT"
set_global_assignment -name SAVE_DISK_SPACE OFF
set_global_assignment -name SMART_RECOMPILE ON
set_global_assignment -name AUTO_PACKED_REGISTERS_STRATIXII AUTO
set_global_assignment -name REMOVE_DUPLICATE_REGISTERS OFF
set_global_assignment -name LOGICLOCK_INCREMENTAL_COMPILE_ASSIGNMENT ON
set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT EXTRA
set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
set_global_assignment -name RESERVE_ALL_UNUSED_PINS_NO_OUTPUT_GND "AS INPUT TRI-STATED"
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top

set_location_assignment PIN_H13 -to clock_50

set_location_assignment PIN_M16 -to inp_resn

# set_location_assignment PIN_N1 -to ledg[7]
# set_location_assignment PIN_AA2 -to ledg[6]
# set_location_assignment PIN_Y3 -to ledg[5]
# set_location_assignment PIN_AA1 -to ledg[4]
# set_location_assignment PIN_W2 -to ledg[3]
# set_location_assignment PIN_U2 -to ledg[2]
# set_location_assignment PIN_N2 -to ledg[1]
# set_location_assignment PIN_U1 -to ledg[0]

# Correct LED placement
set_location_assignment PIN_N1 -to ledg[0]
set_location_assignment PIN_N2 -to ledg[1]
set_location_assignment PIN_U1 -to ledg[2]
set_location_assignment PIN_U2 -to ledg[3]
set_location_assignment PIN_W2 -to ledg[4]
set_location_assignment PIN_AA1 -to ledg[5]
set_location_assignment PIN_AA2 -to ledg[6]
set_location_assignment PIN_Y3 -to ledg[7]


# 512b EEPROM is at P16 / P17
#set_location_assignment PIN_P17 -to io[28]
#set_location_assignment PIN_P16 -to io[29]

set_location_assignment PIN_T9 -to io[31]
set_location_assignment PIN_T10 -to io[30]
set_location_assignment PIN_U12 -to io[29]
set_location_assignment PIN_R9 -to io[28]
set_location_assignment PIN_U10 -to io[27]
set_location_assignment PIN_N16 -to io[26]
set_location_assignment PIN_M18 -to io[25]
set_location_assignment PIN_N19 -to io[24]
set_location_assignment PIN_L17 -to io[23]
set_location_assignment PIN_K17 -to io[22]
set_location_assignment PIN_L18 -to io[21]
set_location_assignment PIN_L19 -to io[20]
set_location_assignment PIN_T17 -to io[19]

set_location_assignment PIN_T18 -to io[18]
set_location_assignment PIN_T20 -to io[17]
set_location_assignment PIN_T19 -to io[16]
set_location_assignment PIN_K22 -to io[15]
set_location_assignment PIN_K21 -to io[14]
set_location_assignment PIN_M21 -to io[13]
set_location_assignment PIN_M20 -to io[12]
set_location_assignment PIN_L22 -to io[11]
set_location_assignment PIN_M22 -to io[10]
set_location_assignment PIN_N21 -to io[9]
#set_location_assignment PIN_R15 -to io[3]
#set_location_assignment PIN_R22 -to io[2]
#set_location_assignment PIN_T15 -to io[1]
#set_location_assignment PIN_T22 -to io[0]


# Button 2
set_location_assignment PIN_J18 -to io[8]

# Button 1
set_location_assignment PIN_H18 -to io[7]

# DIP-Switch
set_location_assignment PIN_G17 -to io[6]
set_location_assignment PIN_D17 -to io[5]
set_location_assignment PIN_C16 -to io[4]

# Support for MicroSD at Pins 0,1,2,3
set_location_assignment PIN_C2 -to io[3]
set_location_assignment PIN_E2 -to io[2]
set_location_assignment PIN_L1 -to io[1]
set_location_assignment PIN_D3 -to io[0]


set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to inp_resn
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[31]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[30]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[29]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[28]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[27]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[26]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[25]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[24]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[23]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[22]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[21]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[20]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[19]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[18]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[17]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[16]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[15]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[14]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[13]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[12]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[11]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[10]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[9]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[8]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[7]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[6]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[5]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[4]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[3]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[2]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[1]
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to io[0]

set_global_assignment -name FMAX_REQUIREMENT "80 MHz" -section_id clock_cog
set_global_assignment -name FMAX_REQUIREMENT "160 MHz" -section_id clock_pll

set_global_assignment -name ENABLE_SIGNALTAP ON
set_global_assignment -name USE_SIGNALTAP_FILE stp1.stp

set_global_assignment -name VERILOG_FILE sram.v
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

Time to Rebuild / Resynthesize the HDL

That’s pretty much all! Now go to Altera Quartus II, load the project, re-synthesize it and upload it according to this instructions:

To compile the P8X32A hardware description and load it into the BeMicroCV:

1) Open Quartus II
2) File | Open Project...
3) Select 'top' file from this directory
4) Press the 'play' button to start compilation (takes several minutes)

5) File | Convert Programming Files
6) Click 'Open Conversion Setup Data...'
7) Select 'P8X32A_BeMicroCV.cof' file
8) Click 'Generate'

9) Tools | Programmer
10) Connect the BeMicroCV to your PC via USB cable
11) Click 'Hardware Setup...'
12) Select 'USB-Blaster', click 'Close'
13) Set 'Mode:' to 'JTAG'
14) Click 'Delete' to clear any files or devices
15) Click 'Add File'
16) Select 'P8X32A_BeMicroCV.jic' file
17) Check 'Program/Configure' box
18) Click 'Start' to begin programming (takes a few minutes)

19) Place the jumper for 3.3V I/O as shown in the .PNG file
20) Unplug and replug the USB cable to cycle power (loads new configuration)
21) P8X32A should now be running on BeMicroCV, indicated by a single green LED (cog0)

22) Install your Propeller Plug into the header as shown in the .PNG file

22) You can now use the regular Propeller Tool software to talk to the P8X32A being emulated in the BeMicroCV

Have fun!