SmartFusion SoftConsole POTlevel UART Tutorial UG
SmartFusion SoftConsole POTlevel UART Tutorial UG
Trademarks
Actel, Actel Fusion, IGLOO, Libero, Pigeon Point, ProASIC, SmartFusion and the associated logos are trademarks or
registered trademarks of Actel Corporation. All other trademarks and service marks are the property of their respective
owners.
Table of Contents
Introduction ..................................................................................................................5
Tutorial Requirements.............................................................................................................................. 5
Objectives ................................................................................................................................................ 6
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 3
Introduction
This tutorial demonstrates how to develop an application that can be implemented using SmartFusion™ intelligent
mixed signal FPGAs. After completing this tutorial, you will be familiar with the following:
1. Creating and implementing a project using SoftConsole and an intelligent mixed-signal SmartFusion FPGA
2. Using SmartDesign to configure the peripherals
3. Configuring the analog compute engine (ACE)
4. Generating an embedded flash memory configuration (EFC), programming database (PDB) file and using
FlashPro to program the SmartFusion Evaluation Kit
5. Compiling the application code
6. Creating and launching a debug session
Tutorial Requirements
Software Requirements
This tutorial requires the following software installed on your computer:
• Actel Libero® Integrated Design Environment (IDE) v9.0 (or newer) that can be downloaded from the link below:
www.actel.com/download/software/libero/files.aspx.
• SoftConsole v3.2 (or newer)
SoftConsole v3.1 comes integrated with Libero IDE v9.0, but the latest version can be downloaded from the link
below:
www.actel.com/download/software/softconsole/default.aspx.http://www.actel.com/download/reg/download.aspx?p=
f=SoftConsolev31
• FlashPro v9.0 (or newer)
FlashPro is often installed as a part of Libero IDE installation and can be launched from within Libero IDE or
standalone.
Target Board
Smart Fusion Evaluation Kit (A2F-EVAL-KIT)
Hardware Requirements
This tutorial requires the following hardware:
• SmartFusion Evaluation Kit board
• Two USB cables (programming and communication). One for connecting the programmer to your computer and the
other to connect the Universal Asynchronous Receiver/Transmitter (UART) interface on the board to computer.
Project Files
You can download the associated solution project files for this tutorial from the Actel website:
www.actel.com/download/rsc/?f=SmartFusion_SoftConsole_POTlevel_UART_tutorial_DF.
The folder contains the following files/folders:
• SoftConsole project
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 5
Introduction
• USB drivers
Objectives
The objective of this tutorial is to explain how to configure the SmartFusion™ MSS peripherals using the SmartFusion
MSS configurator outside the Libero IDE flow. The steps are as follows:
• Configure the SmartFusion MSS peripherals using SmartDesign MSS
• Generate the programming file and program the SmartFusion device
• Create a simple project and run the application using the SoftConsole debugger
As a part of MSS configuration, this tutorial demonstrates how to configure SmartFusion analog channels and ACE
(used to monitor the voltage across the potentiometer).
The UART_0 is used to send the analog to digital Converter (ADC) results to a serial terminal program
(HyperTerminal).
The hardware configuration has four flags:
• Over 1.0 V
• Over 1.5 V
• Over 2.0 V
• Over 2.5 V
The design monitors the voltage across a potentiometer (POT) and the four flags are included for voltage monitoring.
6 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Working with the SoftConsole
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 7
Working with the SoftConsole
2. You can now enter the name of the project (voltage_monitor) and the project will be saved in the default location
that you specified while selecting your workspace (Only_SoftConsole). You can browse to your specified
location; however, it is advisable that you keep your project in the workspace you defined.
3. Select Actel Cortex-M3 Tools and click Next.
8 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 9
Working with the SoftConsole
The Project Name and Project Directory parameters are already specified. Click Next.
Note: If you do not see the latest MSS version (v2.1.108 or above) as shown in Figure 5, you need to change
your repositories settings. Steps for setting up repositories are described in Appendix A -
Vault/Repositories Settings in SmartDesign.
3. Ensure that the following details are selected in the dialog box and click Next:
Family: SmartFusion
Die: A2F200M3F
Package: 484 FPBGA
4. Select Verilog (or VHDL) in the dialog box and click Finish.
Note: If your vault does not have MSS core then SmartDesign will ask to download the core. Click Yes to
download the core.
5. The MSS canvas appears as shown below:
10 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 11
Working with the SoftConsole
Configuring ACE
To configure ACE, double-click the ACE peripheral block and configure as follows:
1. TM0 is connected to the POT on the SmartFusion development board. Configure a voltage monitor to measure the
voltage across the potentiometer and also create flags to indicate when the voltage is greater than 1.0 V, 1.5 V, 2.0
V, and 2.5 V. These flags will be used to monitor the voltage.
12 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 13
Working with the SoftConsole
The next step in configuring the ACE is to enable the sampling sequence. This configuration dialog is launched by
clicking the Controller tab (next to the Configure ACE tab).
6. Select Manual as the Operating sequence entry in the Controller tab.
14 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
9. The Configure SAMPLE window will appear. Select TM0_Voltage and click OK.
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 15
Working with the SoftConsole
13. Click the Flags tab in the Configure ACE window. This tab lists the Flags set from PPE registers.
16 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 17
Working with the SoftConsole
18 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
Configure SmartFusion_CMSIS_PAL_0
1. Click the configuration button as marked in Figure 23 and make sure you select SoftConsole in the Configuration
window. Also, disable the generation of the drivers for the peripherals which are not required.
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 19
Working with the SoftConsole
2. Click OK.
3. Save your design and generate.
20 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
• J13: Connect the mini USB cable. When the cable is inserted, FlashPro drivers might be installed if they are not
already installed.
• J14: Connect the second mini USB cable for power.
Configuring FlashPro
1. Select voltage_monitor project in the Project Explorer window. Open the External Tools dialog box using Run >
External Tools > External Tools Configurations.
2. Double-click Program to create a new configuration.
3. Enter FlashPro in the Name field.
4. Click the Browse File System button in the Location field. The Open dialog box will open.
5. Navigate to <drive> :\< Libero IDE installation folder>\Designer\bin and select flashpro.exe; then click Open.
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 21
Working with the SoftConsole
Figure 27 · FlashPro
1. Create a FlashPro project by clicking the New Project button.
2. Enter the following in the New Project dialog box:
Project Name: POT_UART_FP
Project Location: C:\Actelprj\POT_UART_SoftConsole\Only_SoftConsole
Programming mode: Single device
Note: Project name should be different from the one used in MSS Configuration. If not, then Windows will
prompt for overwrite.
22 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
4. Click Configure Device in the FlashPro GUI. The FlashPro GUI is displayed as shown in Figure 29:
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 23
Working with the SoftConsole
24 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 3 – Configuring External Tools (MSS and FlashPro)
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 25
Working with the SoftConsole
26 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 5 – Installing Drivers for the USB to RS232 Bridge
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 27
Working with the SoftConsole
Sample C code
#include "./drivers/mss_uart/mss_uart.h"
#include "./drivers/mss_ace/mss_ace.h"
#include "./drivers/mss_watchdog/mss_watchdog.h"
#include <stdio.h>
#define Actel_logo \
"\n\r \
******** *** * * \n\r \
******* * * * * \n\r \
****** * * * * * * ***** * * * * * \n\r \
***** * * * * * * * \n\r \
**** ******* * * * * * * * \n\r \
*** * * * * * * \n\r \
** * * * * * * \n\r \
* * * * * * * * * * * * * \n\r"
/*
* main function.
*/
int main()
28 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 6 – Adding a New Source File (main.c) to the Project
{
const uint8_t msg_under_1p0v[]= " ** No Flag: TM0_Voltage < 1V \r\b\r\b";
const uint8_t msg_over_1p0v[] = " ** Flag: TM0_Voltage_over_1p0V\r\b\r\b";
const uint8_t msg_over_1p5v[] = " ** Flag: TM0_Voltage_over_1p5V\r\b\r\b";
const uint8_t msg_over_2p0v[] = " ** Flag: TM0_Voltage_over_2p0V\r\b\r\b";
const uint8_t msg_over_2p5v[] = " ** Flag: TM0_Voltage_over_2p5V\r\b\r\b";
for (;;)
{
uint8_t display_buffer[32];
uint16_t adc_result;
int32_t adc_value_mv;
if ( adc_value_mv < 0 )
{
snprintf( (char*)display_buffer, sizeof(display_buffer),"%s : -
%.3fV", channel_name,((float)(-adc_value_mv) / (float)(1000)));
}
else
{
snprintf( (char*)display_buffer, sizeof(display_buffer),"%s : %.3fV",
channel_name,((float)(adc_value_mv) / (float)(1000)));
}
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 29
Working with the SoftConsole
else
if ( flag_status_1p5v == FLAG_ASSERTED )
MSS_UART_polled_tx( &g_mss_uart0, msg_over_1p5v, sizeof(msg_over_1p5v) );
else
if ( flag_status_1p0v == FLAG_ASSERTED )
MSS_UART_polled_tx( &g_mss_uart0, msg_over_1p0v, sizeof(msg_over_1p0v) );
else
MSS_UART_polled_tx( &g_mss_uart0, msg_under_1p0v, sizeof(msg_under_1p0v));
}
return 0;
}
/*******************************************************************************/
5. Your project explorer will now show the main.c file linked to your project as shown below:
30 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 6 – Adding a New Source File (main.c) to the Project
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 31
Working with the SoftConsole
11. Make sure there are no errors; you can ignore any warnings.
Note: If there are any compilation errors regarding the file or directory missing then use the SoftConsole
directories including feature from Project options > C/C++ Build > settings > GNU C Compiler >
Directories to include the header file directories. This enables the compiler to look in to added directories
for the included header files.
32 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 7 – Running the Application
3. If the C/C++ Application project is not populated, click Search Project to select the program to run.
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 33
Working with the SoftConsole
34 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 7 – Running the Application
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 35
Working with the SoftConsole
36 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 8 – Debugging the Application
3. Select the Variables tab in the upper left window pane to view the value of variables in the source code.
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 37
Working with the SoftConsole
38 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Step 8 – Debugging the ApplicationError! No text of specified style in document.
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 39
Appendix A - Vault/Repositories Settings in
SmartDesign
Listed below are the steps to show how to configure your vault location and set up the repositories in SmartDesign.
1. In SmartDesign, select Options > Vault/Repositories Settings.
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 41
Appendix A - Vault/Repositories Settings in SmartDesign
4. Browse to a location on your computer to set the vault location where the IPs can be downloaded from the
repositories.
42 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Appendix B - Firmware Catalog Settings
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 43
Appendix B - Firmware Catalog Settings
44 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Product Support
Actel backs its products with various support services including Customer Service, a Customer Technical Support
Center, a web site, an FTP site, electronic mail, and worldwide sales offices. This appendix contains information about
contacting Actel and using these support services.
Customer Service
Contact Customer Service for non-technical product support, such as product pricing, product upgrades, update
information, order status, and authorization.
From Northeast and North Central U.S.A., call 650.318.4480
From Southeast and Southwest U.S.A., call 650. 318.4480
From South Central U.S.A., call 650.318.4434
From Northwest U.S.A., call 650.318.4434
From Canada, call 650.318.4480
From Europe, call 650.318.4252 or +44 (0) 1276 401 500
From Japan, call 650.318.4743
From the rest of the world, call 650.318.4743
Fax, from anywhere in the world 650. 318.8044
Website
You can browse a variety of technical and non-technical information on Actel’s home page, at http://www.actel.com/.
Email
You can communicate your technical questions to our email address and receive answers back by email, fax, or phone.
Also, if you have design problems, you can email your design files to receive assistance. We constantly monitor the
email account throughout the day. When sending your request to us, please be sure to include your full name, company
name, and your contact information for efficient processing of your request.
Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion 45
Product Support
Phone
Our Technical Support Center answers all calls. The center retrieves information, such as your name, company name,
phone number and your question, and then issues a case number. The Center then forwards the information to a queue
where the first available application engineer receives the data and returns your call. The phone hours are from 7:00
A.M. to 6:00 P.M., Pacific Time, Monday through Friday. The Technical Support numbers are:
650.318.4460
800.262.1060
Customers needing assistance outside the US time zones can either contact technical support via email
([email protected]) or contact a local sales office. Sales office listings can be found at
www.actel.com/company/contact/default.aspx.
46 Displaying POT Values Over UART: SoftConsole Standalone Flow Tutorial for SmartFusion
Actel is the leader in low power FPGAs and mixed signal FPGAs and offers the most comprehensive
portfolio of system and power management solutions. Power Matters. Learn more at http://www.actel.com .
50200212-2/08.10