Test program running on MAX32625MBED. Control through USB Serial commands using a terminal emulator such as teraterm or putty.
Dependencies: MaximTinyTester CmdLine MAX541 USBDevice
Diff: MAX11043/MAX11043.cpp
- Revision:
- 74:f4f969c9a7a9
- Parent:
- 73:879578472009
- Child:
- 75:0900a57f2e5d
--- a/MAX11043/MAX11043.cpp Sat Feb 22 01:04:36 2020 +0000 +++ b/MAX11043/MAX11043.cpp Sun Feb 23 11:38:40 2020 +0000 @@ -54,9 +54,8 @@ #endif // MAX11043_ScopeTrigger_MAX32625MBED_D5 #if MAX11043_ScopeTrigger_MAX32625MBED_D5 // Diagnostic: Use MAX32625MBED pin D5 as DigitalOut EOC#-detected -#define D5 P0_5 // WIP MAX11043 interrupt EOC echo - moving DigitalOut ScopeTrigger to global scope, it compiles but there is no activity on scope -// DigitalOut ScopeTrigger(D5); +extern DigitalInOut digitalInOut5; // declared in Test_Main_MAX11043.cpp (D5, PIN_INPUT, PullUp, 1) #endif // MAX11043_ScopeTrigger_MAX32625MBED_D5 // Device Name = MAX11043 @@ -228,6 +227,7 @@ // TODO: onEOCFallingEdge: interrupt handler requires global object extern MAX11043 g_MAX11043_device // InterruptIn interruptEOC(EOC_pin); // InterruptIn constructor requires PinName, not DigitalIn -- Error: No instance of constructor "mbed::InterruptIn::InterruptIn" matches the argument list in "MAX11043/MAX11043.cpp", Line: 187, Col: 31 // TODO: onEOCFallingEdge: replace DigitalIn &EOC_pin with PinName EOC_pin, so that I can create an InterruptIn(PinName:EOC_pin) + digitalInOut5.output(); // ScopeTrigger extern void onEOCFallingEdge(void); // interruptEOC.fall(&onEOCFallingEdge); EOC_pin.fall(&onEOCFallingEdge); @@ -249,16 +249,10 @@ // VERIFIED: GPIO PIN pulse in response to EOC# falling edge, no crash on HH, no missed pulses #if MAX11043_ScopeTrigger_MAX32625MBED_D5 // Diagnostic: Use MAX32625MBED pin D5 as DigitalOut EOC#-detected - // WIP MAX11043 interrupt EOC echo - moving DigitalOut ScopeTrigger to global scope, it compiles but there is no activity on scope - DigitalOut ScopeTrigger(D5); - // With ScopeTrigger declared inside interrupt handler, - // latency is 2.64us before first ScopeTrigger even visible on scope - // then 5.32us to final event, - // 160us between high/low events. - ScopeTrigger = 0; - ScopeTrigger = 1; - ScopeTrigger = 0; - ScopeTrigger = 1; + digitalInOut5.write(0); // ScopeTrigger 1.8us after EOC# falling edge + digitalInOut5.write(1); // ScopeTrigger + digitalInOut5.write(0); // ScopeTrigger + digitalInOut5.write(1); // ScopeTrigger #endif // MAX11043_ScopeTrigger_MAX32625MBED_D5 #endif #if 0 @@ -275,6 +269,8 @@ // -- MbedOS Error Info -- extern MAX11043 g_MAX11043_device; g_MAX11043_device.Read_ADCabcd(); + // read register ADCabcd -> &adca, &adcb, &adcc, &adcd + // g_MAX11043_device.RegRead(CMD_0001_1010_d16o8_d16o8_d16o8_d16o8_Rd06_ADCabcd, 0); #endif } #endif // MAX11043_EOC_INTERRUPT_POLLING