Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
EE Times-Asia > Processors/DSPs

Basics of ARM design on mbed IDE (Part 2)

Posted: 13 Nov 2013 ?? ?Print Version ?Bookmark and Share

Keywords:mbed? software tools? compiler? ARM? API?

Using functions is not always completely beneficial, however. There is a small execution time overhead in storing program position data and jumping and returning from the function, but this should only be an issue for consideration in the most time-critical systems. Furthermore, it is possible to 'nest' functions within functions, which can sometimes make software challenging to follow. A limitation of C functions is that only a single value can be returned from the function, and arrays of data cannot be passed to or from a function (only single-value variables can be used). Working with functions and modular techniques therefore requires a considered software structure to be designed and evaluated before programming is started.

Figure 1: A function call.

Using flowcharts to define code structure
It is often useful to use a flowchart to indicate the operation of program flow and the use of functions. Code flow can be designed using a flowchart prior to coding. Figure 2 shows some of the flowchart symbols that are used.

Figure 2: Example flowchart symbols.

For example, take the following software design specification:

Design a program to increment continuously the output of a seven-segment numerical light-emitting diode (LED) display (as shown in figure 3, and similar to the one used in Part 1) through the numbers 0 to 9, then reset back to 0 to continue counting. This includes:

???Use a function to convert a hexadecimal counter byte A to the relevant seven- segment LED output byte B.
???Output the LED output byte to light the correct segment LEDs.
???If the count value is greater than 9, then reset to zero.
???Delay for 500 ms to ensure that the LED output counts up at a rate that is easily visible.

Figure 3: Seven-segment display.

The output of the seven-segment display has been discussed previously in Part 1 and in particular in Table 3.4. A feasible software design is shown in figure 4.

Figure 4: Example flowchart design for a seven-segment display counter.

?First Page?Previous Page 1???2???3???4?Next Page?Last Page

Article Comments - Basics of ARM design on mbed IDE (Pa...
*? You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.

Back to Top