@@ -66,7 +66,9 | |||
|
66 | 66 | //ADC parameters |
|
67 | 67 | #define REP 1 //defines how many times the data acquisation loop is repeated |
|
68 | 68 | #define NSAMPLES 10 //defines how many samples are taken in one data acqu- |
|
69 | // isation loop | |
|
69 | // isation loop | |
|
70 | ||
|
71 | #define NLOOPS 200 // Number of loops for the transmisor checking | |
|
70 | 72 | #define CNVTIME 14.3 //defines how long it takes to get one sample. Value |
|
71 | 73 | // is only needed for the output file, doesn't change |
|
72 | 74 | // any ADC configurations |
@@ -394,8 +396,13 | |||
|
394 | 396 | tx_data = chequeo_sistema(filename2,rx_data); |
|
395 | 397 | printf("%s\n",tx_data); |
|
396 | 398 | } |
|
397 |
else if(strcmp(cmd," |
|
|
398 |
tx_data = ABS_monitoreo(1, |
|
|
399 | else if(strcmp(cmd,"BGPH") == 0){ | |
|
400 | tx_data = ABS_monitoreo(1, 0, 50, 10); | |
|
401 | // tx_data = "Not implemented\n"; | |
|
402 | printf("%s\n",tx_data); | |
|
403 | } | |
|
404 | else if(strcmp(cmd,"LWPH") == 0){ | |
|
405 | tx_data = ABS_monitoreo(0, 0, 50, 10); | |
|
399 | 406 | // tx_data = "Not implemented\n"; |
|
400 | 407 | printf("%s\n",tx_data); |
|
401 | 408 | } |
@@ -685,6 +692,8 | |||
|
685 | 692 | float phase2; |
|
686 | 693 | char page0[30]; |
|
687 | 694 | char page1[20]; |
|
695 | ||
|
696 | int cnt = 0; | |
|
688 | 697 | //system("./map_clock"); |
|
689 | 698 | /* |
|
690 | 699 | if (configCLK() == 1) |
@@ -749,20 +758,33 | |||
|
749 | 758 | sleep(1); |
|
750 | 759 | |
|
751 | 760 | //Se toman muestras para el canal 1 del detector de fase |
|
752 |
/ |
|
|
761 | /*while(1){ | |
|
753 | 762 | for(i=0; i < NSAMPLES; i++){ |
|
754 | 763 |
|
|
755 | 764 | ADC_INIT(padc); |
|
756 | 765 | results1[i] = GET_ADC0(padc); |
|
757 | 766 | results2[i] = GET_ADC1(padd); |
|
758 | 767 | } |
|
759 | /* | |
|
768 | ||
|
760 | 769 | if (checkTx(results1, results2, umbral, pulsewidth)==1){ //Se verifica que las muestras tomadas del canal 1 del datector de fase //correspondan a un pulso. |
|
761 | 770 | break; |
|
762 | 771 | } |
|
763 | */ | |
|
764 | //} | |
|
765 | ||
|
772 | ||
|
773 | }*/ | |
|
774 | ||
|
775 | do{ | |
|
776 | for(i=0; i < NSAMPLES; i++){ | |
|
777 | ||
|
778 | ADC_INIT(padc); | |
|
779 | results1[i] = GET_ADC0(padc); | |
|
780 | results2[i] = GET_ADC1(padd); | |
|
781 | } | |
|
782 | ||
|
783 | if (checkTx(results1, results2, umbral, pulsewidth)==1){ //Se verifica que las muestras tomadas del canal 1 del datector de fase //correspondan a un pulso. | |
|
784 | break; | |
|
785 | } | |
|
786 | cnt += 1; | |
|
787 | }while (cnt < NLOOPS); | |
|
766 | 788 | |
|
767 | 789 | //Se pone la salida de selecci�n de canal para seleccionar el canal 2 del detector de fase |
|
768 | 790 | acumulado_ceros = acumulado_ceros - (1 << 4); |
@@ -773,20 +795,32 | |||
|
773 | 795 | |
|
774 | 796 | |
|
775 | 797 | //Setoman muestras para el canal 2 del detector de fase |
|
776 |
/ |
|
|
798 | /* while(1){ | |
|
777 | 799 | for(i=0; i < NSAMPLES; i++){ |
|
778 | 800 |
|
|
779 | 801 | ADC_INIT(padc); |
|
780 | 802 | results3[i] = GET_ADC0(padc); |
|
781 | 803 | results4[i] = GET_ADC1(padd); |
|
782 | 804 | } |
|
783 | /* | |
|
805 | ||
|
784 | 806 | if (checkTx(results3, results4, umbral, pulsewidth)==1){ //Se verifica que las muestras tomadas del canal 2 del detector de fase //correspondan a un pulso. |
|
785 | 807 | break; |
|
786 | 808 | } |
|
787 |
|
|
|
788 | // } | |
|
789 | ||
|
809 | }*/ | |
|
810 | cnt = 0; | |
|
811 | do{ | |
|
812 | for(i=0; i < NSAMPLES; i++){ | |
|
813 | ||
|
814 | ADC_INIT(padc); | |
|
815 | results3[i] = GET_ADC0(padc); | |
|
816 | results4[i] = GET_ADC1(padd); | |
|
817 | } | |
|
818 | ||
|
819 | if (checkTx(results3, results4, umbral, pulsewidth)==1){ //Se verifica que las muestras tomadas del canal 2 del detector de fase //correspondan a un pulso. | |
|
820 | break; | |
|
821 | } | |
|
822 | cnt += 1; | |
|
823 | }while(cnt < NLOOPS); | |
|
790 | 824 | |
|
791 | 825 | //Una vez que se ha encontrado un pulso en cada canal, se calcula la fase de ambos. |
|
792 | 826 |
General Comments 0
You need to be logged in to leave comments.
Login now