Reference firmware for PixArt's PAT9125EL sensor and evaluation board. "Hello World" and "Library" contain the exact same files. Please import just one of the two into your mBed compiler as a new program and not as a library.

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

Files at this revision

API Documentation at this revision

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