background image

 

AN-000227

 

 

Document Number: AN-000227

 

Page 6 of 15

 

 

Revision: 1.0  

 

 

BUILDING THE PRESENCE DETECTION APPLICATION 

 

Open Atmel Studio 7  

 

Open the Presence Detection project:  

o

 

Open 

File

 menu  

o

 

Select 

File > Open > Project/Solution…

 

o

 

Select the 

atmelstudio/smartsonic-presence-example/smartsonic-presence-example.atsln 

file 

in the project directory.  

o

 

Click 

Open

. The program should locate the project files and display the name of the project.  

 

The Presence Detection project files are organized in three top-level sub-directories under 

source

:  

o

 

algo

– contains 

src

 and 

inc

 sub-directories with the motion detection algorithm code and 

definitions 

o

 

application

 – contains src and inc directories with the Presence Detection application 

 

The 

application/smartsonic-presence-example/main.c

 file contains the entry point for 

the application along with various routines that demonstrate how to read and manage 

the Chirp sensor(s). See the comments in that file for detailed information about the 

operation of the application.  

 

The 

application/smartsonic-presence-example/inc/app_config.h

 file specifies the 

overall measurement interval. The default is 100 ms (10 Hz sample rate). 

o

 

board

 – contains support files for the Chirp SmartSonic board.  

 

The main board support package routines, as defined in 

drivers/chirpmicro/inc/chirp_bsp.h

, are in the 

board/HAL/src/chbsp_chirp_samg55.c

 

file.  

 

The 

board/config/chirp_board_config.h

 file is required by SonicLib. This file contains 

definitions for the number of possible devices and I

2

C buses on the board and is used for 

static allocation of arrays.  

o

 

drivers/chirpmicro

 – contains the SonicLib API and driver files, sensor firmware modules, and 

other distribution files from Chirp.  

 

The 

drivers/chirpmicro/inc

 directory contains header files that must be included when 

building applications with SonicLib. In particular, the 

drivers/chirpmicro/inc/soniclib.h

 

file contains the key definitions for the SonicLib API.  

 

Build the project: 

o

 

Select 

Build > Build Solution

  

The project should build successfully. The default build configuration is “Debug” so the build 

output files will be placed in the 

Debug

 sub-directory. 

 

 

Summary of Contents for SmartSonic CH201

Page 1: ...specifications and information herein without notice Chirp Microsystems 2560 Ninth Street Ste 220 Berkeley CA 94710 U S A 1 510 640 8155 www chirpmicro com Document Number AN 000227 Revision 1 0 Relea...

Page 2: ...d on the presence detection algorithm In this example the application is built using Atmel Studio 7 for the Chirp SmartSonic evaluation board which features an Atmel SAMG55 microcontroller The SmartSo...

Page 3: ...Detection Application 9 Changing the Presence Detection Application Settings 13 6 1 MEASUREMENT_INTERVAL_MS 13 Reference Documents 14 Revision History 15 LIST OF FIGURES Figure 1 SmartSonic with CH20...

Page 4: ...e white arrows Optional Using flat flex cables attach additional off board sensor s to the connectors on the daughterboard If an offboard sensor is connected to the Sensor 0 connector J6 you must set...

Page 5: ...ort number assigned to the SmartSonic board There will be one port associated with the SmartSonic board called EDBG A second COM port will also be assigned but is not used in this application o The ED...

Page 6: ...ion about the operation of the application The application smartsonic presence example inc app_config h file specifies the overall measurement interval The default is 100 ms 10 Hz sample rate o board...

Page 7: ...gramming Screen Verify that the tool is EDBG device is ATSAMG55J19 and interface is SWD Select Apply o Note Atmel Studio 7 may require you to update the EDBG debug interface firmware on the SmartSonic...

Page 8: ...00227 Page 8 of 15 Revision 1 0 Figure 3 Device Signature and Target Voltage Select Memories on the Device Programming menu The Device Programming menu will prompt for the name of the file to program...

Page 9: ...the Atmel Studio 7 debugging features it does not matter which file you use Select Program Your SmartSonic board is successfully programmed when the Device Programming screen displays the OK messages...

Page 10: ...e o Sensor number o Boolean indicator of whether object presence was detected 0 no presence 1 presence o Range measurement expressed in millimeters o Confidence level expressed as a percentage In the...

Page 11: ...orithm detects changes in the ultrasound environment it is normal for the first few measurement cycles to report no presence detected Figure 6 shows the typical application output during initializatio...

Page 12: ...rements has been made the presence of objects can be detected Figure 7 shows typical application output during operation with two sensors The Merged output lines indicate the overall Presence Detectio...

Page 13: ...pplication s timing 6 1 MEASUREMENT_INTERVAL_MS Specifies how often a new measurement cycle will be initiated in milliseconds Default 100 ms 10Hz sample rate This value is used in main as a parameter...

Page 14: ...AN 000227 Document Number AN 000227 Page 14 of 15 Revision 1 0 REFERENCE DOCUMENTS AN 000214 Presence Detection AN 000226 CH201 Ultrasonic Presence Detection Reference Design User Guide...

Page 15: ...the infringement of patents copyrights mask work and or other intellectual property rights Certain intellectual property owned by Chirp Microsystems and described in this document is patent protected...

Reviews: