Skip to content

Commit

Permalink
[bt] update bt docs for H3.2
Browse files Browse the repository at this point in the history
MH3-7212
  • Loading branch information
tom-crosley committed Mar 15, 2019
1 parent 88aec8f commit 3c57300
Show file tree
Hide file tree
Showing 51 changed files with 987 additions and 70 deletions.
Binary file modified doc/help_harmony_bluetooth.chm
Binary file not shown.
Binary file modified doc/help_harmony_bluetooth.pdf
Binary file not shown.
108 changes: 87 additions & 21 deletions docs/00003.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,45 +66,82 @@
<strong>Note:</strong>&nbsp;</div></td><td class="Element67" valign="top" width="92%" style="border:none;">
<div class="Element68">
This MPLAB Harmony application has been designed to also work with a smartphones running Android™, as well as an iPhone; however, the firmware on the BM64 module currently does not support connections to Android smartphones. If you need this application to work with an Android™ phone, please contact your local Microchip Marketing Representative as to the possibility of getting an update to the BM64 firmware.&nbsp;</div></td></tr></table></div></div>
<div class="Element15">
<p class="Element10">
To know more about the MPLAB Harmony Bluetooth Drivers, configuring the Bluetooth Drivers, and the APIs provided by the Bluetooth Drivers, refer to Codec Driver Libraries.&nbsp;</p>
<p class="Element10">
&nbsp;</p><div class="Element15">
Architecture</div>
<p class="Element10">
This application runs on the SAM E70 Xplained Ultra board, which contains a ATSAME70Q21B microcontroller with 2 MB of Flash memory and 384 KB of RAM running at 300 MHz with the following features:</p>
There are three different projects packaged in this application.&nbsp;</p>
<p class="Element10">
<u>SAM E70 Xplained Ultra Project:</u>&nbsp;</p>
<p class="Element10">
This project runs on the SAM E70 Xplained Ultra board, which contains a ATSAME70Q21B microcontroller with 2 MB of Flash memory and 384 KB of RAM running at 300 MHz with the following features:</p>
<ul class="Element630">
<li class="Element600">Single user push button (SW1)</li>
<li class="Element600">Two user LEDs (LED1 and 2)</li>
<li class="Element600">USB Device and Host interfaces</li>
<li class="Element600">Single user push button</li>
<li class="Element600">Two user LEDs (only one is used)</li>
<li class="Element600">One X32 sockets, used for the BM64 Bluetooth module daughterboard.</li>
</ul><div class="Element63">
<div class="TableDiv">
<table cellspacing="0" class="Table0">
<tr>
<td class="Element67" valign="top" width="5%" style="border:none;">
<div class="Element68">
<img src="Note Icon.png" border="0" alt="" title="">&nbsp;</div></td><td class="Element67" valign="top" width="5%" style="border:none;">
<img src="Note Icon.png" border="0" alt="" title="">&nbsp;</div></td><td class="Element67" valign="top" width="7%" style="border:none;">
<div class="Element68">
<strong>Notes:</strong>&nbsp;</div></td><td class="Element67" valign="top" width="90%" style="border:none;">
<strong>Notes:</strong>&nbsp;</div></td><td class="Element67" valign="top" width="88%" style="border:none;">
<div class="Element68">
</p>
<ol class="Element630">
<li value="1" class="Element600">The SAM E70 Xplained Ultra does not include the BM64 Bluetooth Module Daughter Board. It must be purchased separately from microchipDIRECT, part number AC320032-3.</li>
<li value="2" class="Element600">The USB Device and Host interfaces <i>are not used</i> in this application.</li>
</ol><p class="Element68">
&nbsp;</div></td></tr></table></div></div>
The SAM E70 Xplained Ultra does not include the BM64 Bluetooth Module Daughter Board. It must be purchased separately from microchipDIRECT, part number AC320032-3.&nbsp;</div></td></tr></table></div></div>
<p class="Element10">
The following figure illustrates the application architecture: </p><p class="Element10" style="text-align: center;">
<img src="APPS BT bm64 ble commE70 architecture diagram.png" border="0" alt="" title=""></p><p class="Element10">
The ATSAME70Q21B microcontroller (MCU) runs the application code, and communicates with the BM64 over a USART interface operating at 115,200 baud. The BM64 module contains its own Bluetooth stack, so it is unnecessary to include a software Bluetooth stack in the MCU. The program takes up only about 1% (21 KB) of the ATSAME70Q21B microcontroller’s program space, and 1% (3 KB) of its RAM.&nbsp;</p>
The ATSAME70Q21B microcontroller (MCU) runs the application code, and communicates with the BM64 over a USART interface operating at 115,200 baud. The BM64 module contains its own Bluetooth stack, so it is unnecessary to include a software Bluetooth stack in the MCU. The program takes up about 1% (21 KB) of the ATSAME70Q21B microcontroller’s program space, about 1% (3 KB) of its RAM. No heap is used.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
<u>SAM E70 Xplained Ultra Project using FreeRTOS:</u>&nbsp;</p>
<p class="Element10">
This project is identical to the bare-metal version above, except that it uses FreeRTOS. The program takes up about 2% (43 KB) of the ATSAME70Q21B microcontroller’s program space, and 1% (26 KB) of the RAM. No heap is used. The application architecture is the same as the previous project, except for the addition of the FreeRTOS block (not shown)&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
<u>SAM E70 Xplained Ultra Project with LCD display:</u>&nbsp;</p>
<p class="Element10">
This project runs on the SAM E70 Xplained Ultra Board, which contains a ATSAME70Q21B microcontroller with 2 MB of Flash memory and 384 KB of RAM running at 300 MHz using the following features:&nbsp;</p>
<p class="Element10">
• WM8904 Codec Daughter Board mounted on a X32 socket&nbsp;</p>
<p class="Element10">
• PDA TM4301B 480x272 (WQVGA) Display </p><div class="Element63">
<div class="TableDiv">
<table cellspacing="0" class="Table0">
<tr>
<td class="Element67" valign="top" width="5%" style="border:none;">
<div class="Element68">
<img src="Note Icon.png" border="0" alt="" title="">&nbsp;</div></td><td class="Element67" valign="top" width="5%" style="border:none;">
<div class="Element68">
<strong>Notes:</strong>&nbsp;</div></td><td class="Element67" valign="top" width="90%" style="border:none;">
<div class="Element68">
The SAM E70 Xplained Ultra board does not include either the WM8904 Audio Codec daughterboard or the TM4301B graphics<br>card, which are sold separately on microchipDIRECT as part numbers AC328904 and AC320005-4, respectively.&nbsp;</div></td></tr></table></div></div>
<p class="Element10">
The following figure illustrates the application architecture, for this project: </p><p class="Element10" style="text-align: center;">
<img src="APPS BT bm64 ble commE70 gfx architecture diagram.png" border="0" alt="" title=""></p><p class="Element10">
The program takes up to approximately 16% (318 KB) of the ATSAME70Q21B microcontroller’s program space, and 71% (338 KB) of the RAM, including a 32 KB heap.&nbsp;</p>
<p class="Element10">
The button and LEDs are interfaced using GPIO pins.&nbsp;</p>
&nbsp;</p>
<p class="Element10">
Except for the user interface, the same application code is used without change between the various projects.&nbsp;</p>
<p class="Element10">
As with any MPLAB Harmony application, the SYS_Initialize function, which is located in the <span class="Element146">system_init.c</span> source file, makes calls to initialize various subsystems, such as the clock, ports, board support package (BSP), PMP, BM64, timers, UART, graphics, and interrupts.&nbsp;</p>
<p class="Element10">
The BM64 driver, graphics, and the application state machines are all updated through calls located in the SYS_Tasks function in <span class="Element146">system_tasks.c</span> file. Interrupt handlers in the <span class="Element146">system_interrupt.c</span> file are only used for receiving characters from the UART and for the two timers.&nbsp;</p>
<p class="Element10">
The application code is contained in two principal source files. The first, <span class="Element146">app.c</span>, contains a simple state machine (APP_Tasks), which initializes the application, and then while idle, calls a secondary state machine, buttonTasks, to process any button pushes (resulting in a call to the BM64 driver to send a string from the BM64 to a connected smartphone).&nbsp;</p>
The application code is contained in two principal source files. The first, <span class="Element146">app.c</span>, contains a simple state machine (APP_Tasks), which first initializes the application, and then while idle. In the non-GUI version of the program, it calls a secondary state machine, buttonTasks, to process any button pushes (resulting in a call to the BM64 driver to send a string from the BM64 to a connected smartphone). In the GUI version, an event handler for the touch screen processes the on-screen button press and sends a string from the BM64 to a connected smartphone.&nbsp;</p>
<p class="Element10">
APP_Tasks also calls another secondary state machine (bleTasks), which is located in the source file <span class="Element146">ble.c</span> to process BLE-related tasks. bleTasks receives a handle to the BM64 driver by calling DRV_BT_Open, and then registers an event handler, _BLEEventHandler, as a callback with the BM64 driver. The callback is called when either a message is received from the BM64 or when the BLE status changes (i.e., when it is connected or disconnected). Both of these actions result in updates to the LED and/or display.&nbsp;</p>
<p class="Element10">
APP_Tasks also calls another secondary state machine (bleTasks), which is located in the source file <span class="Element146">ble.c</span> to process BLE-related tasks. bleTasks receives a handle to the BM64 driver by calling DRV_BT_Open, and then registers an event handler, _BLEEventHandler, as a callback with the BM64 driver. The callback is called when either a message is received from the BM64 or when the BLE status changes (i.e., when it is connected or disconnected). Both of these actions result in updates to the LED.</p><div class="Element15">
For two of the projects, the button and LEDs are interfaced using GPIO pins. In the other project, a 480x272 LCD screen is used as the user interface.&nbsp;</p>
<p class="Element10">
&nbsp;</p><div class="Element15">
Demonstration Features</div>

<ul class="Element630">
Expand All @@ -116,20 +153,49 @@
<li class="Element600">Sending of a text string from the SAM E70 Xplained Ultra board/BM64 to the smartphone when a button is pressed</li>
<li class="Element600">Sending of a text string from the smartphone to the BM64/SAM E70 Xplained Ultra board, causing an LED to turn on or off.</li>
<li class="Element600">Sending and receiving characters between the USART of the SAM E70 MCU and the BM64.</li>
<li class="Element600">Processing of button pushes on the SAM E70 Xplained Ultra board using a state machine for contact debouncing. (see Ports Peripheral Library)</li>
<li class="Element600">Use of two timers: one as a periodic 1 ms timer for the application for debouncing the button, and a second used by the BM64 driver (see Timer Driver Library)</li>
<li class="Element600">For two of the projects, processing of button pushes on the SAM E70 Xplained Ultra board using a state machine for contact debouncing (see Ports Peripheral Library)</li>
<li class="Element600">For the third project, responding to touch events.</li>
<li class="Element600">Use of two timers: one as a periodic 1 ms timer for the application for button debouncing or touch button timing, and a second used by the BM64 driver (see Timer Driver Library)</li>
</ul><p class="Element10">
&nbsp;</p>
<div class="Element15">
Tools Setup Differences</div>
<p class="Element10">
When building a new application, start by creating a 32-bit MPLAB Harmony 3 project in MPLAB X IDE by selecting <i>File &gt; New Project</i>. Chose the Configuration name the based on the BSP. Select the appropriate processor (ATSAME70Q21B).&nbsp;</p>
<p class="Element10">
In MHC, under Available Components select the BSP SAM E70 Xplained Ultra. Under Bluetooth<i>&gt;Templates</i>, double-click on BM64 Bluetooth. Answer Yes to all questions.&nbsp;</p>
In MHC, under Available Components select the BSP SAM E70 Xplained Ultra. Under Bluetooth<i>-&gt;Templates</i>, double-click on BM64 Bluetooth. Answer Yes to all questions.&nbsp;</p>
<p class="Element10">
You should end up with a project graph that looks like this, after rearranging the boxes: </p><p class="Element10" style="text-align: center;">
<img src="APPS BT BM64 BLE comm Project Graph.png" border="0" alt="" title=""></p><p class="Element10">
In the Project Graph, click on TC0 in the graph, and and in the Configuration Options dialog expand Channel 0, and under Enable&gt;Operating Mode&gt;Timer uncheck Enable Compare Interrupt and check Enable Periodic Interrupt. Finally click on USART0 in the graph, and change the Baud Rate to 115,200 in the Configuration Options dialog.</p></div>
Click on USART0 in the graph, and change the Baud Rate to 115,200 in the Configuration Options dialog.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
If building an application that is goling to use the 480x272 display, then do the following instead. In the MHC, under Available&nbsp;</p>
<p class="Element10">
Components select the BSP (SAM E70 Xplained Ultra). Under Graphics&gt;Templates, double-click on Aria Graphics w/ PDA&nbsp;</p>
<p class="Element10">
TM4301B Display. Answer Yes to all questions except for the one regarding FreeRTOS; answer No to that one.&nbsp;</p>
<p class="Element10">
Then under Audio&gt;Templates, double-click on WM8904 Codec. Answer Yes to all questions.&nbsp;</p>
<p class="Element10">
You should end up with a project graph that looks like this, after rearranging the boxes: </p><p class="Element10" style="text-align: center;">
<img src="APPS BT bm64 ble comm gfx project graph.png" border="0" alt="" title=""></p><p class="Element10">
&nbsp;</p>
<p class="Element10">
If using the SAM E70 Xplained Ultra board, in the Clock Diagram, in the Clock Diagram, set MOSCEL to Main Crystal, check the&nbsp;</p>
<p class="Element10">
Bypass checkbox, and uncheck the RC Crystal Oscillator and Main Crystal Oscillator boxes, to make use of the 12 MHz external&nbsp;</p>
<p class="Element10">
oscillator:&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
If using FreeRTOS, in the code you will need to move the call to DRV_WM8904_Tasks(sysObj.drvwm8904Codec0); from the&nbsp;</p>
<p class="Element10">
SYS_Tasks function in src/config/&lt;config_name&gt;/tasks.c to inside the while(1) loop of _APP_Tasks (just before the call to&nbsp;</p>
<p class="Element10">
APP_Tasks).</p></div>
</div>
<a name="546F70696373"></a><div class="Element14">
Topics</div>
Expand Down
28 changes: 21 additions & 7 deletions docs/00004.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,34 @@
<div class="TableDiv">
<table cellspacing="0" class="Table3">
<tr>
<td class="Element65" valign="top" width="24%">
<td class="Element65" valign="top" width="18%">
<div class="Element66">
Project Configuration Name&nbsp;</div></td><td class="Element65" valign="top" width="9%">
Project Configuration Name&nbsp;</div></td><td class="Element65" valign="top" width="7%">
<div class="Element66">
BSP Used&nbsp;</div></td><td class="Element65" valign="top" width="67%">
BSP Used&nbsp;</div></td><td class="Element65" valign="top" width="75%">
<div class="Element66">
Description&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="24%">
<td class="Element67" valign="top" width="18%">
<div class="Element68">
bm64_boot_sam_e70_xult_bm64&nbsp;</div></td><td class="Element67" valign="top" width="9%">
bm64_ble_sam_e70_xult_bm64&nbsp;</div></td><td class="Element67" valign="top" width="7%">
<div class="Element68">
sam_e70_xult&nbsp;</div></td><td class="Element67" valign="top" width="67%">
sam_e70_xult&nbsp;</div></td><td class="Element67" valign="top" width="75%">
<div class="Element68">
This demonstration runs on the ATSAME70Q21B processor on the SAM E70 Xplained Ultra board and the BM64 Bluetooth Module Daughter Board.&nbsp;</div></td></tr></table></div></div>
This demonstration runs on the ATSAME70Q21B processor on the SAM E70 Xplained Ultra board and the BM64 Bluetooth Module Daughter Board.&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="18%">
<div class="Element68">
bm64_ble_sam_e70_xult_bm64_freertos&nbsp;</div></td><td class="Element67" valign="top" width="7%">
<div class="Element68">
sam_e70_xult&nbsp;</div></td><td class="Element67" valign="top" width="75%">
<div class="Element68">
This demonstration runs on the ATSAME70Q21B processor on the SAM E70 Xplained Ultra board and the BM64 Bluetooth Module Daughter Board. It also uses FreeRTOS.&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="18%">
<div class="Element68">
bm64_ble_sam_e70_xult_bm64_wqvga&nbsp;</div></td><td class="Element67" valign="top" width="7%">
<div class="Element68">
sam_e70_xult&nbsp;</div></td><td class="Element67" valign="top" width="75%">
<div class="Element68">
This demonstration runs on the ATSAME70Q21B processor on the SAM E70 Xplained Ultra board and the BM64 Bluetooth Module Daughter Board, , plus a PDA TM4301B 480x272 (WQVGA) display.&nbsp;</div></td></tr></table></div></div>
</div>
</div>
</div>
Expand Down
21 changes: 17 additions & 4 deletions docs/00005.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
<a name="4465736372697074696F6E"></a><div class="Element11">
<div class="Element10">
<p class="Element10">
If using the SAM E70 Xplained Ultra board:&nbsp;</p>
<p class="Element10">
No special configuration except for the addition of the BM64 Bluetooth Module daughterboard. </p><div class="Element63">
For projects using the SAM E70 Xplained Ultra board, no special configuration except for the addition of the BM64 Bluetooth Module daughterboard. The jumpers (JP1-JP4) are not used and can be in either position, or absent. The two slide switches SW1 on the BM64 daughterboard should be off, as shown in Figure 1. </p><div class="Element63">
<div class="TableDiv">
<table cellspacing="0" class="Table0">
<tr>
Expand All @@ -62,7 +60,22 @@
<strong>Note:</strong>&nbsp;</div></td><td class="Element67" valign="top" width="89%" style="border:none;">
<div class="Element68">
The SAM E70 Xplained Ultra does not include the BM64 Bluetooth Module Daughter Board. It must be purchased separately from microchipDIRECT, part number AC320032-3.&nbsp;</div></td></tr></table></div></div>
</div>
<p class="Element10">
For the project also using the 480x272 display, attach the flat cable of the PDA TM4301B 480x272 (WQVGA) display to the 565 daughterboard connected to the SAM E70 Xplained Ultra board GFX CONNECTOR. </p><div class="Element63">
<div class="TableDiv">
<table cellspacing="0" class="Table0">
<tr>
<td class="Element67" valign="top" width="5%" style="border:none;">
<div class="Element68">
<img src="Note Icon.png" border="0" alt="" title="">&nbsp;</div></td><td class="Element67" valign="top" width="6%" style="border:none;">
<div class="Element68">
<strong>Note:</strong>&nbsp;</div></td><td class="Element67" valign="top" width="89%" style="border:none;">
<div class="Element68">
The SAM E70 Xplained Ultra does not include the PDA TM4301B 480x272 (WQVGA) display. It must be purchased separately from microchipDIRECT, part number AC320005-4.&nbsp;</div></td></tr></table></div></div>
<p class="Element10" style="text-align: center;">
<img src="APPS BT sam e70 bm64.png" border="0" alt="" title="">&nbsp;</p>
<p class="Element10" style="text-align: center;">
<i>Figure 1. SAM E70 Xplained Ultra Board with BM64 Daughter Board</i></p></div>
</div>
</div>
<!-- End Page Content -->
Expand Down
Loading

0 comments on commit 3c57300

Please sign in to comment.