Hi,
I have an embedded system with an AT89C51SNDC1 (which have only one UART) So actually I have only one external serial connection for debugging this UART by a DB9 connector.
for my new application I must implement the reading of data comming from a GPS oem (each second). Because of I have only one UART (on pins P3.0 and P3.1 are connected a debug cable) incoming data from GPS must be connected to the same pins of connector of UART than use for debugging (perhaps only on RX pin of the µc because of GPS incoming), so I think so but I don't know if it is correct?
for that I suppose to use every short time of each second reading of data coming from GPS in my infinite loop, but how exactly do that? Must I use software interrupts?
In my actual program there is no interrupts.
So how must I implement that, could you help me please?
PS: So I suppose that hardwarelly I will have an external connector with "Y" cable.
Thank you
Best Regards,
Sems
Sorry I forgetted to add my infinite loop code:
// INITIALIZATION while(1) { if ((P1_0 == 1)&&(P1_1 == 1)&&(P1_2 == 1)&&(P1_3 == 1)&&(P3_5 == 1)) { //printf("dans if de while(1)\n"); //0805 ADC_cpt++; if (ADC_cpt == ADC_cpt_end) { CAG(); if (set_tempo) { tempo_1(1/20000000); } } if (ADC_cpt > ADC_cpt_end) { ADC_cpt = 0; } micro(); } else { // printf("dans else de while(1)\n"); //0805 ADC_cpt1++; if (ADC_cpt1 == ADC_cpt_end1) { CAG(); if (set_tempo) { tempo_1(1/20000000); } } if (ADC_cpt1 > ADC_cpt_end1) { ADC_cpt1 = 0; } micro(); } } //End of infinite loop //End of main program
But I don't know where in this loop to put exactly the reading from GPS. And for facilities i will red only the GPRMC message look like this :
$GPRMC,235952,V,5051.9116,N,00422.3928,E,0.000,0.0,280697,1.
Best regards,