hi, i am doing gps tracking device prject but i am unable to receive any data from my EM-506 Module, i am using to the following piece of code to capture data: void Serial_Init() { TMOD = 0x20; TH1 =0xF4; SCON = 0x50; TR1 = 1; }
rx_data(void) { char x; while(RI==0); x=SBUF RI = 0; //lcd("2"); return x; }
i noticed that the programm is stuck because RI never changes his state but when i measure the the voltage of p3.0 (RX pin of 8051) it changes ("0" and "1") so the cpu receives data from the gps.
thanks in advance.
Below a certain level you can do anything and the processor pin will still always read a zero.
Above that, you have a window where you don't know what will happen. Maybe read as zero. Maybe read as one. Maybe read as random noise. Maybe result in high power consumption. Likely to change behaviour from small change of temperature or supply voltage.
Above that you have a level where the input signal will always be detected as a one.
If your GPS signal does not have "0" transmited below the maximum allowed low voltage, and have "1" transmitted above the minimum allowed high voltage, then you are on your own. You have failed with the contracts terms, and the processor is free to misbehave in whatever way it feels like with the exception of fatal outcomes like catching fire.
If you go shopping for a sound system and the price tag says $1000 and you hand over $850 you might get it. Or the shop might ignore you. You'll depend on luck if the payment gets accepted despite being less than the requested amount. The difference is that when buying things, you can negotiate and if you get a no, you can give up or you can hand over the full amount. When designing hardware - if you skip fulfilling all contractual agreements between the different chips you just have to pray that it works and continues to work. But you most certainly can't _expect_ that it should work.