Académique Documents
Professionnel Documents
Culture Documents
ems
Design IV
(2015
S2)
Semester Project
Report
Rahman Z, 208063707
2) Scope
according to the project description, the platform must perform the following tasks:
a) startup screen:
when the platform starts, it is required to display a splash screen containing our
details such as student name and number (Rahman Z, 208063707). this information
must be visible for 15 seconds
b) Graphical user interface
the GUI is ASCII based and should be shown on a terminal based program on a PC
OS (in this project, we use Real Terminal because its dimensions can be set for size).
the GUI should exhibit creativity through ASCII art and colourful displays.
c) user input
there has to be a form of instructions that can teach the user to operate the device,
the device should use a keyboard for commands, using the tab and enter functions
for updating the table. the variables that are to change are the frequency and
phase.
d) function generator output
a sine wave must be displayed on the function generator output, the frequency and
phase should be displayed and must concur with the wave shown on the graphic
interface. this signal must update when there is a change in data. in our case, we
update it whenever we press enter.
as an example, the following image was provided for reference:
Rahman Z, 208063707
3) Hardware
the first step to solving such a problem is to select an ARM microcontroller upon
which we can program this onto, by much research and suggestions, as well as
employment influence, I had selected the NUCLEO F401RE board which is a
development board manufactured by ST microcontrollers, this board is a flexible and
powerful platform upon which many types of development projects are possible. the
board comes with its own programmer (the ST_LINK_V2), its photo and block
diagram is displayed below:
Rahman Z, 208063707
4) Software
the STM NUCLEO is MBED enabled, MBED is an online IDE that works on the basis of
IOT, this enables us to work on this board from anywhere there is access to the
internet. given the computer has the necessary drivers installed for the ST_LINK_V2
and has their programmers firmware updated. both drivers and firmware upgrade
software is readily available from the STM website. instructions on how to use these
are also available online.
since there is no desktop based software, the entire project can be built in the
online interface, since the device is MBED enabled, this opens a flash device on "my
computer" which acts as a storage device for the program. in the online IDE of
MBED, once you compile, it generates a .bin file that you save onto the Nucleo
storage device and once saved, your board is programmed.
to use this online development environment, the user must register (registration is
free) to receive an online profile. once the profile is created, a platform must be
selected (NUCLEO STM32F401RE), the compiler must be opened and the selected
MBED enabled device will appear as one of the devices belonging to the user. given
the device identity being known by the IDE, a host of functions and declarations
that are used throughout the online environment are modified to work on the
4
Rahman Z, 208063707
5) Firmware
now that the hardware and software to be used has been determined, the
programming begins. initially the following functions are tested: blinking an LED,
interrupts, serial echo, serial interrupt, PWM etc.
5
Rahman Z, 208063707
Rahman Z, 208063707
Rahman Z, 208063707
Rahman Z, 208063707
Rahman Z, 208063707
as shown in the above code, an extra file was included, the file_repository header
file was used to store the arrays for the splash screen and frame. the files text is
shown below:
/*--------file_repository.h--------*/
char splash_frame[30][70] = {
'_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','
_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_
','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_'
,'|',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','
',' ',' ','R','A','H','M','A','N',',','Z',' ','2','0','8','0','6','3','7','0','7',' ',' ',' ','
',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','|'
,'|',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','E','l','P',':','
','(','F',')','a','s','t',' ',';',' ','(','S',')','l','o','w',' ',';','
','(','E',')','a','r','l','y',' ',';',' ','(','l',')','a','t','e',' ',' ',' ',' ',' ',' ',' ','
',' ',' ',' ',' ',' ',' ','|'
,'|','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_',
'_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','
_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','|'
10
Rahman Z, 208063707
11
Rahman Z, 208063707
12
Rahman Z, 208063707
the above file is quite difficult to understand, but once the splash function is
understood, generating a file like this becomes much more clearer.
6) outcome
with the above code programmed into a STM nucleo board, we plug in the usb port
and a virtual port opens up. using Real Terminal, we set the following:
under the display tab, set the rows to 30 and the columns to 70. also select
ANSI as the display text.
under port, select the correct USB COM port, set the baud rate to 115200,
click on "open" twice, this will refresh the screen.
since the board is already powered, you will need to press the reset button on
the board to restart the application from start. press the black button on your
nucleo
if all goes well, we are able to see an outgoing wave that looks as follows:
13
Rahman Z, 208063707
14
Rahman Z, 208063707
end of report
15
Rahman Z, 208063707