Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Parallel Processing Demo Using Timer FIQ on ARM 7

By Sunny Kushwaha October 28, 2013

NEED:-

The need for this project aroused when once I was trying to interface uart and multiplexed ssds together. The problem was that I had to do 2 process simultaneously that is receive characters from uart send them back to uart, print them at the same time update all ssds. Now ssds use persistent of vision that is a particular ssd is turned on digit is displayed on it then after few microseconds other ssd is turned on and corresponding digit is displayed and this goes on for other ssds also. So to this a mechanism had to be developed that after few us turns on a ssd displays digit, then after few us turns other ssd on displays corresponding digit and at the same time receive digits from uart put them back and displays on term. And apart from displaying on term also update digits to be displayed on ssds.

Overview of Parallel Processing on ARM 7
Fig. 1: Overview of Parallel Processing on ARM 7
SOLUTION:-
To do this firstin arm7 timer 0 is selected as fast interrupt request (fiq) so that after every 1ms it generates interrupt and executes its isr. In the isr one of ssds of multiplexed ssd (ssd1) is turned on and corresponding number (dig1) is displayed then after 1ms again isr is executed and other ssd (ssd2) is turned on and other number (dig2) is displayed and the same process goes on. Initially dig1, dig2, dig3, dig4 have 0 values so all ssds show 0. Now In the while one arm waits for 4 digits if 4 digits are entered at term and terminated by a and received by arm then it displays on LCD, sends back to term and updatesdig1, dig2, dig3, dig4 so digits to be displayed on ssds are updated. If digits entered is not equal to 4 then error is displayed on LCD, term and errr on ssds. 
MULTIPLEXED SSD DISPLAY AND POV:-
Basically it consists of four ssds having common a, b, c, d, e, f, g, h and one enable as shown in figure. The principle used is PERSISTENCE OF VISION (POV).Persistent of vision is the phenomenon by which an afterimage is thought to persist for approximately 1/25 of second on retina. So to obtain continuity first an image is displayed then before 1/25 of second another image is displayed so we human see it as continuous one. Same as in video camera shows images one by one at certain rate (<1/25 of second) one over the other so that we see it as continuous one. In order to do this first one of the ssd is turned on then corresponding to number to be displayed pattern is generated by turning some bits on and off of a, b, c, d, e, f, g and h. Then after few ms (I have taken 1ms) other ssd is turned on and corresponding to number to be displayed some bits of a, b, c, d, e, f, g, h are turned on and off. Then same process is continued for other 2 ssds also. So if after every 1ms delay ssds are turned on then if a particular ssd is turned on and a digit displayed it would take 4ms for it to turn on again and that is (4/1000 of second) so we would see it as a continuous image. This principle can be used in a number of phenomena like task scheduling, parallel processing etc.
h = DP
Representational Image of Multiplexed SSD Display with Pin Descriptions
Fig. 2: Representational Image of Multiplexed SSD Display with Pin Descriptions
ARM 7 TIMER 0 AS FIQ
(Code explanation)
ARM 7 has 32 sources of interrupts and it has 3 types of interrupts (fiq, vectored irq and non-vectored irq) in this project timer 0 is declared as fiq. Fiq as the name suggests is fast interrupt request and has the first priority that is if we have many interrupts and if more than one interrupt (i.e. it’s isr) needs to be served then isr of fiq will be served first followed by vectored irq then non vectored irq and for the same reason fiq is used for task scheduling.
 In this project as said timer 0 is declared as fiq and its isr is executed after every 1ms. I took 4 variables dig1, dig2, dig3, dig4 and assigned them = 0 globally. Ssds enable are active low and connected to P0.10, P0.11, P0.12, P0.13 so In the isr first one of the ssd (eg ssd1) is turned on by sending 0 to P0.10 as active low enable and then corresponding to dig1 i/o pins which are connected to a, b, c, d, e, f, g, h of ssds are turned on and off note these are also active low. I/O pins connected to ssd digit showing part are:-
a = P0.2
b = P0.23
c = P0.15
d = P0.14
e = P0.6
f = P0.7
g = P0.8
h = P0.9

Understanding Coding

Then after 1ms again isr is executed and other ssd (eg ssd2) is turned on by sending 0 through other i/o pin P0.11 connected to other ssd’s enable and corresponding to dig2 i/o pins connected to a, b, c, d, e, f, g, h of ssds are turned on and off. And the same process continues. For other ssds also. Initially dig1, dig2, dig3, dig4 = 0 so each ssd shows a 0.
Screenshot of Virtual Terminal
Fig. 3: Screenshot of Virtual Terminal
In isr first a variable is statically declared=0 then there are four conditions comparing count to 0,1,2 and 3 so as isr is executed first count is incremented then compared if it equals 0 then ssd1 is turned on and a function ssd_display (dig1) is called which displays dig 1 on ssd then again when isr is executed count is incremented if it == 1 then ssd2 turned on and corresponding digit displayed using ssd_display (dig2) same process is continued for others but when count==3 ssd4 is turned on and digit displayed using ssd_display (dig4) and count made to 0. So as count=0 so again same process goes on from ssd1.   
In while(1) first arm7 sends the string “enter 4 digit number“to be printed on vterm, done using function uart0_putstrn (““) then waits to receive (this can also be based interrupt based) 4 digit number for this I used an array digit [], the function uarto_getch () and a while loop.First of all I took a variable I (i) assigned digit [0]=0 incremented I(i) then saved the received char in digit[i] this is done till digit[i]!=’a’ so this continues till ‘a’ is sent from term so after the entering the number at terminal to send we press a and this is done using while loop condition while (digit[i]!=’a’)
We see that if a 4 digit number is entered then I is incremented 5 times so to check if number is a 4 digit or not I used the if condition. if i==5 then the number is of 4 digit otherwise not. Now if number! =4 digit number then ‘error’ is sent back to terminal using uart0_putstrn (), displayed on LCD using lcd_strn() and dig1=10, dig2=11, dig3=11, dig4=11 are updated corresponding to these value errr is displayed on ssd (this can be seen in function ssd_display). If number==4 digit number then the number is sent back to terminal, displayed on LCD and
dig1=digit[1]-48;
dig2=digit[2]-48;
dig3=digit[3]-48;
dig4=digit[4]-48;
are updated. This is done as uart_getch returns char so the array digit [] is of char type but ssd_display takes int value so this is basically char to int conversion. So like this the process goes on.
Now I also used important function ssd_display ( int ) it takes numbers from 0-9 and corresponding to the number turns on and off a, b, c, d, e, f, g, h of ssds by turning on and off respective i/o s.
Note in this project we have just one interrupt so fiq doesn’t matter much but if we have many fiq, irq then it matters.
This can’t be done sequentially.
U can also do many processes like this. (Task scheduler)
IMPORTANT INFORMATION
-IDE used KEILUVISION 4
– SIMULATED on PROTEUS 7.1
– BOARD used LPC2148
– Codes provided
            – vterm_num_print
– Hex files provided
            – vterm_num_print.hex
– Some additional .h and .c are also provided like delay, uart0, timerfiq etc.
– Proteus .dsn is also provided vterm.dsn.
All these are in their respective folders i.e:-
-vterm_num_print
-proteus_vterm
-Build schematic on proteus load the provided hex files in respective lpc2148 then run to see output.
Circuit Images
Prototype of LPC2138 Interfacing with Multiplexed SSD Display
Fig. 4: Prototype of LPC2138 Interfacing with Multiplexed SSD Display
Image showing numbers displayed on SSD Display successfully from LPC2138
Fig. 5: Image showing numbers displayed on SSD Display successfully from LPC2138
Image showing numbers displayed on SSD Display incorrectly from LPC2138
Fig. 6: Image showing numbers displayed on SSD Display incorrectly from LPC2138

 

Circuit Diagrams

Circuit-Diagram-LPC2138-ARM-Microcontroller-Interfacing-Multiplexed-SSD-Display

Project Video


Filed Under: Electronic Projects
Tagged With: arm7, parallel processing
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • ADS optimization cockpit window does not open
  • Voltage mode pushpull is a nonsense SMPS?
  • Will this TL084C based current clamp circuit work?
  • How to determine the maximum PAD frequency ?
  • Xiaomi Mijia 1C Robot problem of going backwards while working

RSS Electro-Tech-Online.com Discussions

  • Siemens large industrial PLC parts
  • Parts required for a personal project
  • Cant log in to Easy PC forum
  • Failure of polypropylene motor-run capacitors
  • Wideband matching an electrically short bowtie antenna; 50 ohm, 434 MHz

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection
  • Convection-cooled power controller integrates EtherCat connectivity

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe