Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Welcome to the code repository for PixArt's PAT9125EL sensor and evaluation board.
For general information about this product, please visit this product's components page here:
https://os.mbed.com/components/PAT9125EL-Evaluation-Board/
For guides and tips on how to setup and evaluate the PAT9125EL sensor with the Nordic nRF52-DK microcontroller using this reference code, please visit this guide:
https://os.mbed.com/teams/PixArt/code/9125_referenceCode/wiki/Guide-for-nRF52-DK-Platform
For guides and tips on how to setup and evaluate the PAT9125EL sensor with any microcontroller using this reference code, please visit this guide:
https://os.mbed.com/teams/PixArt/code/9125_referenceCode/wiki/Guide-for-Any-Platform
Revision 4:8f7d8ff001f8, committed 2018-07-23
- Comitter:
- PixArtVY
- Date:
- Mon Jul 23 22:14:06 2018 +0000
- Parent:
- 3:979019410df2
- Child:
- 5:577976dae20d
- Commit message:
- Fixed some SPI timing.
Changed in this revision
| commHeaders/SPIcommFunctions.h | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/commHeaders/SPIcommFunctions.h Wed Jul 18 18:33:38 2018 +0000
+++ b/commHeaders/SPIcommFunctions.h Mon Jul 23 22:14:06 2018 +0000
@@ -47,7 +47,6 @@
cs = 0; //Set chip select low/active
addr = addr & 0x7F; //Set MSB to 0 to indicate read operation
spi.write(addr); //Write the given address
- wait_us(1); //Add a tiny delay after sending address for some internal cycle timing.
uint8_t data_read = spi.write(0x00); //Throw dummy byte after sending address to receieve data
cs = 1; //Set chip select back to high/inactive
return data_read; //Returns 8-bit data from register
--- a/main.cpp Wed Jul 18 18:33:38 2018 +0000
+++ b/main.cpp Mon Jul 23 22:14:06 2018 +0000
@@ -13,11 +13,15 @@
//=======================
//Revision History
//=======================
+Version 1.2 -- 23 July 2018
+-Changed SPI frequency to 2MHz.
+-Changed SPI timing for the readRegister function.
+
Version 1.1 -- 18 July 2018
-Added apache license notice.
+-Added apache license notice.
Version 1.0 -- 16 Feb. 2018
-First release.
+-First release.
*/
#include "mbed.h"
@@ -32,7 +36,7 @@
#ifdef SPImode
spi.format(8,3); // Set SPI to 8 bits with inverted polarity and phase-shifted to second edge.
- spi.frequency(1000000); // Set frequency for SPI communication.
+ spi.frequency(2000000); // Set frequency for SPI communication.
cs = 1; // Initialize chip select as inactive.
#endif
PAT9125EL | Versatile Low-Energy Surface Tracking Sensor