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.
Fork of Impedance_Fast_Circuitry by
Diff: main.cpp
- Revision:
- 50:33524a27e08c
- Parent:
- 49:4dcf4717a8bb
- Child:
- 51:43143a3fc2d7
--- a/main.cpp Sat Jan 31 19:16:22 2015 +0000 +++ b/main.cpp Sat Jan 31 19:46:00 2015 +0000 @@ -56,93 +56,51 @@ case 'g': pc.printf("Quad Cnt: %i\r\n", quad_read()); break; + /* case 'A': case 'a': // needs debugging adc_start(); for(int i = 0; i < 1500; i++) asm("nop"); adc_stop(); - // then proceed to 's' to display the array - case 'S': + // then proceed to 's' to display the array*/ + case 'F': // clear the samples + case 'f': + for(int i = 0; i < len; i++) {sample_array0[i] = 0; sample_array1[i] = 0; angle_array[i] = 0;} + pc.printf("Arrays cleared\r\n"); + // then display the samples + case 'S': // display what's been sampled case 's': for(int i = 0; i < len; i++) pc.printf("%i: %f\t %f\t %i\r\n",i,sample_array0[i]*3.3/65535,sample_array1[i]*3.3/65535, angle_array[i]); pc.printf("\r\n"); break; + /* case 'D': case 'd': adc_single_sample(); // trigger ADCs, which trigger DMA DMA_TCD2_CSR |= DMA_CSR_START_MASK; // trigger encoder DMA - break; - case 'F': - case 'f': - for(int i = 0; i < len; i++) {sample_array0[i] = 0; sample_array1[i] = 0; angle_array[i] = 0;} - pc.printf("Arrays cleared\r\n"); - break; + break;*/ + + + + + + // Programmable Delay Block debug case 'B': case 'b': + pc.printf("Started PCB...samples being taken\r\n"); pdb_start(); break; case 'K': case 'k': - pc.printf("STOPPED\r\n"); + pc.printf("Stopped PCB\r\n"); pdb_stop(); break; case 'V': case 'v': pc.printf("PDB: %i\r\n",PDB0_CNT); break; - case 'P': - case 'p': - pc.printf("***********************\r\n"); - pc.printf("ADC0_SC1a: %08x\r\n",ADC0_SC1A); //(0x0000004d) - pc.printf("ADC0_SC1b: %08x\r\n",ADC0_SC1B); //(0x0000001f) - pc.printf("ADC0_CFG1: %08x\r\n",ADC0_CFG1); //(0x0000000c) - pc.printf("ADC0_CFG2: %08x\r\n",ADC0_CFG2); //(0x00000004) - pc.printf("ADC0_RA: %08x\r\n",ADC0_RA); //(0x00000000) - pc.printf("ADC0_RB: %08x\r\n",ADC0_RB); //(0x00000000) - pc.printf("ADC0_SC2: %08x\r\n",ADC0_SC2); //(0x00000044) - pc.printf("ADC0_SC3: %08x\r\n\n",ADC0_SC3); //(0x00000000) - - pc.printf("ADC1_SC1a: %08x\r\n",ADC1_SC1A); //(0x0000004d) - pc.printf("ADC1_SC1b: %08x\r\n",ADC1_SC1B); //(0x0000001f) - pc.printf("ADC1_CFG1: %08x\r\n",ADC1_CFG1); //(0x0000000c) - pc.printf("ADC1_CFG2: %08x\r\n",ADC1_CFG2); //(0x00000004) - pc.printf("ADC1_RA: %08x\r\n",ADC1_RA); //(0x00000000) - pc.printf("ADC1_RB: %08x\r\n",ADC1_RB); //(0x00000000) - pc.printf("ADC1_SC2: %08x\r\n",ADC1_SC2); //(0x00000044) - pc.printf("ADC1_SC3: %08x\r\n\n",ADC1_SC3); //(0x00000000) - - pc.printf("PDB0_SC: %08x\r\n",PDB0_SC); - pc.printf("PDB0_MOD: %08x\r\n",PDB0_MOD); - pc.printf("PDB0_CNT: %08x\r\n",PDB0_CNT); - pc.printf("PDB0_IDLY: %08x\r\n",PDB0_IDLY); - pc.printf("PDB0_CH0C1: %08x\r\n",PDB0_CH0C1); - pc.printf("PDB0_CH0S: %08x\r\n",PDB0_CH0S); - pc.printf("PDB0_CH0DLY0: %08x\r\n",PDB0_CH0DLY0); - pc.printf("PDB0_CH0DLY1: %08x\r\n",PDB0_CH0DLY1); - pc.printf("PDB0_CH1C1: %08x\r\n",PDB0_CH1C1); - pc.printf("PDB0_CH1S: %08x\r\n",PDB0_CH1S); - pc.printf("PDB0_CH1DLY0: %08x\r\n",PDB0_CH1DLY0); - pc.printf("PDB0_CH1DLY1: %08x\r\n\n",PDB0_CH1DLY1); - - pc.printf("DMA_CR: %08x\r\n", DMA_CR); - pc.printf("DMA_ES: %08x\r\n", DMA_ES); - pc.printf("DMA_ERQ: %08x\r\n", DMA_ERQ); - pc.printf("DMA_EEI: %08x\r\n", DMA_EEI); - pc.printf("DMA_CEEI: %02x\r\n", DMA_CEEI); - pc.printf("DMA_SEEI: %02x\r\n", DMA_SEEI); - pc.printf("DMA_CERQ: %02x\r\n", DMA_CERQ); - pc.printf("DMA_SERQ: %02x\r\n", DMA_SERQ); - pc.printf("DMA_CDNE: %02x\r\n", DMA_CDNE); - pc.printf("DMA_SSRT: %02x\r\n", DMA_SSRT); - pc.printf("DMA_CERR: %02x\r\n", DMA_CERR); - pc.printf("DMA_CINT: %02x\r\n", DMA_CINT); - pc.printf("DMA_INT: %08x\r\n", DMA_INT); - pc.printf("DMA_ERR: %08x\r\n", DMA_ERR); - pc.printf("DMA_HRS: %08x\r\n", DMA_HRS); - pc.printf("***********************\r\n"); - break; } } }