CASP models can be deployed on embedded micro-controller boards. This example, models hardware digital input (with hardware interrupt enabled) and outputs driving a 7-segmented display on Arduino Uno board.

Pre-Requisites

  • Arduino Uno R3 is connected to the computer.
  • A push button switch, 10K resistor, 7-segmented display, bread board and some bread board jumper wires.
  • CASP software is installed.
  • Arduino BSP is installed.
  • The project files are located at CASP installed directory ‘CASP/support/examples/hardware_interface/01_di_intr_7seg_display’. These are also available for download at this link.

Description

A push button switch is connected to pin-2 of the target board. A 7-segment LED display is connected from pin-3 to pin-9 as shown in the circuit diagram. A model is developed to count number of times the push button is pressed and display on the 7-segment display. After 15 counts, the count will restart from zero. Please go through the individual block parameters used in the model along with respective documentation for better understanding.

CASP Model

Procedure

  • Run CASP and open the project ‘CASP/support/examples/hardware_interface/01_di_intr_7seg_display/01_di_intr_7seg_display.prj’ from CASP installed directory.
  • Open ‘Setup Simulation’ window and change the ‘Target Programmer Port’ to which the board is connected.
  • Click Run button to build the model and program the board.

Related Links