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.
"3.3v output of gps to 5v input of 8051"
That depends on what 8051 chip you have.
Some chips are designed to play nice with 3V3 devices. But some 8051 chips will be unhappy. Especially if the GPS uses TTL rules and don't go rail-to-rail but have an output voltage that is significantly lower than 3V3.
Just as an addendum. One important reason for the existence of data sheets is to make it possible to verify the min and max low and high in/out limits and the absolute max input/output limits to verify that a specific output pin on one device is compatible with the input of another device.
For more advanced designs, timing, capacitances etc also needs to be verified. So you might have to check max output current and compute how fast it can charge/discharge a capacitive load and if that is fast enough for required rise/fall times.
Anyway - ignoring data sheets is a good way to end up with unexpected and sometimes very unpredictable problems. You might create a design that seems to work well unless it's a warm day or the battery is below half capacity. When inputs/outputs aren't compatible, lots of strange things can happen.
5 minutes of validation of pin specifications can save hours or days of frustration, and a potentially huge rework.