grand_parent: Reference Applications parent: SAM E51 Integrated
Graphics & Touch (IGAT) Curiosity Evaluation Kit title: Barcode
Scanner nav_order: 1

Barcode
Scanner Application using SAM E51 Integrated Graphics & Touch (IGAT)
Curiosity Evaluation Kit
Description:
This application detects the EAN-13 barcode and decodes it with the
help of the ArduCAM Mega camera module. The ArduCAM Mega captures an
image with a resolution of 1920x1080 and stores the image in an internal
memory. The decoded barcode is then displayed on the serial console and
graphical display.
Modules/Technology Used:
- Peripheral Modules
- ADC
- NVMCTRL
- EVSYS
- NVIC
- PORT
- SYSTICK
- SERCOM - SPI
- SERCOM - UART
- TC
- CCL
- Drivers
- SPI Driver
- External Display Controller Driver
- System Services
- Middleware libraries
- Harmony Core
- Legato Graphics
<img src = "images/project_graph.png">
Hardware Used:
This project has been verified to work with
the following versions of software tools:
Refer Project
Manifest present in harmony-manifest-success.yml under the project
folder firmware/src/config/sam_e51_igat
- Refer the Release Notes to
know the MPLAB® X IDE and MCC Plugin
version. Alternatively, Click
Here
- Any Serial Terminal application like Tera Term terminal
application.
Because Microchip regularly update tools,
occasionally issue(s) could be discovered while using the newer versions
of the tools. If the project doesn’t seem to work and version
incompatibility is suspected, It is recommended to double-check and use
the same versions that the project was tested with.
To download original version of MPLAB® Harmony v3 packages, refer to
document How
to Use the MPLAB® Harmony v3 Project Manifest Feature
Setup:
Connect the ArduCAM Camera module to the SAM E51
Integrated Graphics & Touch (IGAT) Curiosity Evaluation Kit
as shown below.
Connect the ArduCAM pins directly to the Extra Port pins
interface (J203). i.e.

Connect a micro-USB cable to the DEBUG USB port
of the SAM E51 Integrated Graphics & Touch (IGAT) Curiosity
Evaluation Kit to power the board and for programming and
debugging.
Programming hex file:
The pre-built hex file can be programmed by following the below
steps
Steps to program the hex
file
- Open MPLAB® X IDE
- Close all existing projects in IDE, if any project is opened.
- Go to File -> Import -> Hex/ELF File
- In the “Import Image File” window, Step 1 - Create Prebuilt Project,
Click the “Browse” button to select the prebuilt hex file.
- Select Device has “ATSAME51J20A”
- Ensure the proper tool is selected under “Hardware Tool”
- Click on “Next” button
- In the “Import Image File” window, Step 2 - Select Project Name and
Folder, select appropriate project name and folder
- Click on “Finish” button
- In MPLAB® X IDE, click on “Make and Program Device” Button. The
device gets programmed in sometime.
- Follow the steps in “Running the Demo” section below
Programming/Debugging
Application Project:
- Open the project (same51_barcode_scanner/firmware/sam_e51_igat.X) in
MPLAB® X IDE
- Ensure “SAM E51 Integrated Graphics & Touch Curiosity” is
selected as hardware tool to program/debug the application
- Build the code and program the device by clicking on the “Make and
Program Device” button in MPLAB® X IDE tool bar
- Debugging the project can be done by clicking on the “Debug Main
Project” button in MPLAB® X IDE tool bar
- Follow the steps in “Running the Demo” section below.
Running the Demo:
- Open a standard terminal application on the computer (like Putty or
Tera Term) and configure the virtual COM port.
- Set the serial baud rate to 115200 baud in the
terminal application.
- Wait for the initialization prints in the serial port terminal. If
it does not show any prints, give the command “0”
through terminal console which resets the development board.
- When the ArduCAM Mega Camera is enabled in the
demonstration, wait for the initialization confirmation from the
development board. This will be printed on the serial port
terminal.
- Show the Barcode in front of the camera for capture (maintain a
minimum distance of 10 to 15 cm).
- Give the command “1” through terminal console.
- An LED “LED0” on the SAM E51 Integrated
Graphics & Touch (IGAT) Curiosity Evaluation Kit toggles
when the scanning is in progress.
- Once the scanning is completed, the result will be displayed in the
terminal console as well as graphical display also.
Output:
Note: - This demo supports EAN-13 barcodes only. -
Print the EAN-13 type barcode on a A4 sheet and show it before the
ArduCAM Mega Camera module (keep a distance of 10 to 15 cm).
- Reference Applications:
- This application demo builds and works out of box by following the
instructions above in “Running the Demo” section. If you need to
enhance/customize this application demo, you need to use the MPLAB®
Harmony v3 Software framework. Refer links below to setup and build your
applications using MPLAB® Harmony.
Revision:
- v1.7.0 - Released demo application