David Jung
/
MAX32664C_MAXM86146_Mode1_Optical
Mode1 Optical Validation
Diff: main.cpp
- Revision:
- 46:553559610878
- Parent:
- 45:d26b8bcce561
- Child:
- 47:346a13fbdc0f
diff -r d26b8bcce561 -r 553559610878 main.cpp --- a/main.cpp Tue Apr 19 23:23:51 2022 +0000 +++ b/main.cpp Fri Apr 29 17:13:58 2022 +0000 @@ -37,7 +37,7 @@ /****************************************************************************** * https://os.mbed.com/users/phonemacro/code/MAX32664C_Example_Host_Code * Tera Term output is set to 115200 baud rate. -* ver: 220419 +* ver: 220429 ******************************************************************************/ /****************************************************************************** @@ -51,9 +51,9 @@ /*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*/ // define one and only one of the following three platforms -//#define MAXM86146_CFG 1 // tested on MAXM86146EVSYS_sensorBrd+MAXM86161_ADAPTER_REVB+MAX32630FTHR 33.13.12 +#define MAXM86146_CFG 1 // tested on MAXM86146EVSYS_sensorBrd+MAXM86161_ADAPTER_REVB+MAX32630FTHR 33.13.12 //#define MAXREFDES103_CFG // not tested -#define MAXM86161_CFG 1 // tested on MAXM86161+MAX32630FTHR v32.9.22, 32.13.12 +//#define MAXM86161_CFG 1 // tested on MAXM86161+MAX32630FTHR v32.9.22, 32.13.12 /*****************************************************************************/ /*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*/ @@ -84,8 +84,11 @@ #endif /*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*/ -//#define RAW // define this if you want AFE+accel data, no algorithm -#define ALGO_ONLY 1 // define this if you only want algo data, comment out if you want raw sensor+algo data +// comment the three below if you want raw sensor+algo data +#define ALGO_ONLY 1 // define this if you only want algo data +//#define RAW // define this if you want AFE+accel data, no algorithm, tested on 33.13.31 + #define RAW_HZ 256 // Raw data rate + //#define RAW_HZ 100 // Raw data rate // Comment out both of the below for Normal Algorithm Samples Format //#define EXTENDED_ALGO 1 // define this if you want the extended algo samples report format @@ -917,6 +920,13 @@ pc.printf("raw1.6 part id Status: %x %x\n\r", rsp[0], rsp[1]); // raw1.8 sample rate 100 Hz, ave 1 +#if RAW_HZ == 100 + cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x12; cmd[3] = 0x18; // set AFE reg 0x12 to 100 Hz +#elif RAW_HZ == 256 + cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x12; cmd[3] = 0x78; // set AFE reg 0x12 to 256 Hz +#else + cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x12; cmd[3] = 0x18; // set AFE reg 0x12 to 100 Hz +#endif // cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x12; cmd[3] = 0x00; // set AFE reg 0x12 to 25 Hz cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x12; cmd[3] = 0x18; // set AFE reg 0x12 to 100 Hz // cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x12; cmd[3] = 0x20; // set AFE reg 0x12 to 200 Hz @@ -1027,7 +1037,13 @@ while (1) { tmr1.start(); #if defined(RAW) + #if RAW_HZ == 100 if (tmr1.read_ms() >= 10) { + #elif RAW_HZ == 256 + if (tmr1.read_ms() >= 4) { + #else + if (tmr1.read_ms() >= 10) { + #endif #else #ifdef REDUCE_RPT_PERIOD #ifdef USE_FIFO_BUFFER_CNT