Connect LVTTL to PIC

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Connect LVTTL to PIC

Postby shahrul » Fri Mar 16, 2012 5:16 pm

Hi,
I want connect GPS SKM53 to PIC16F887. The GPS output is 2.85V LVTTL.
I have done connect GPS to USB-to-UART and display on VB. This is succesfull.

I connect GPS TX directly to PIC RX, PIC can't read signal.
Then I make transistor level like below, also PIC can't read signal.
Schematic-GPS-Receiver[1].jpg
Schematic-GPS-Receiver[1].jpg (9.42 KiB) Viewed 6522 times

This is weird, I use this method for FV-M8 (formerly named as EB-85A) before.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Connect LVTTL to PIC

Postby robosang » Fri Mar 16, 2012 6:58 pm

Seem to be correct, but cannot just verify the signal with USB to UART converter? Which is after the transistors.

BTW, what is the baudrate?
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Connect LVTTL to PIC

Postby shahrul » Fri Mar 16, 2012 7:47 pm

robosang WROTE:Seem to be correct, but cannot just verify the signal with USB to UART converter? Which is after the transistors.

BTW, what is the baudrate?

The baudrate 9600. If GPS leave open, (measure with multimeter) the voltage goes 2.XX V and 1.XX V, so I know there is UART signal high and low. But, after connect the transistor, GPS TX fixed at 2.XX V and PIC RX fixed 5V.
I don't know why this connection 'stuck' the signal.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Connect LVTTL to PIC

Postby robosang » Fri Mar 16, 2012 8:15 pm

OK, would you mind posting the hardware setup? A clear photo if possible 8-)
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Connect LVTTL to PIC

Postby shahrul » Fri Mar 16, 2012 10:08 pm

robosang WROTE:OK, would you mind posting the hardware setup? A clear photo if possible 8-)

Ok, let me take photo tomorrow.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Connect LVTTL to PIC

Postby shahrul » Sat Mar 17, 2012 9:19 am

Here the photo
Method 1, connect GPS >> USB-to-UART
DSC09629.JPG

Method 2, connect GPS >> XBee ----- XBee >> USB-to-UART
DSC09630.JPG

The result on VB
GPS Data.jpg
GPS Data.jpg (55.31 KiB) Viewed 6462 times

The transistor circuit is below the XBee
DSC09631.JPG

The bottom of this, I simply use jumper to connect what I want
DSC09632.JPG


GPS TX >> PIC RX, PIC TX >> XBee or GPS TX >> Transistor >> PIC RX, PIC TX >> XBee
These 2 can't function.

I program sending in 2 place, like
CODE: SELECT_ALL_CODE
while(1){
if(receive_gps(){
uart_string("1");}

uart_string("2");
__delay_ms(100);
}

But, only no 2 appear on Serial Communication. That I know, PIC not read GPS UART signal.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Connect LVTTL to PIC

Postby robosang » Sat Mar 17, 2012 10:32 am

Hey, shahrul, very nice photo! Super clear!

Seem to me the hardware is correct :) and tidy!


CODE: SELECT_ALL_CODE
while(1){
if(receive_gps(){
uart_string("1");}

uart_string("2");
__delay_ms(100);
}


I think you misses at ")" after the receive_gps() for the if statement. But it should be your typo because this is not escape the compiler :)

What is the specification of GPS? Can you give the link of the datasheet?
Another thing you can verify is to use UC00A, connect to transistor and GPS.

UC00A's RX ---- Transistors ---- GPS's TX. To verify that the transistor logic converter is working or the problem at PIC.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Connect LVTTL to PIC

Postby ABSF » Sat Mar 17, 2012 10:51 am

Wow !! Your arrangement of components and soldering on the back of PCB is really FIRST CLASS. It must have taken a lot of patience and time to do it. I normally use stripboard and a 1/8" drill bit with hand drill to separate the trace. Plus some wire wrapping pins.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Connect LVTTL to PIC

Postby ABSF » Sat Mar 17, 2012 11:41 am

shahrul WROTE:
robosang WROTE:Seem to be correct, but cannot just verify the signal with USB to UART converter? Which is after the transistors.

BTW, what is the baudrate?

The baudrate 9600. If GPS leave open, (measure with multimeter) the voltage goes 2.XX V and 1.XX V, so I know there is UART signal high and low. But, after connect the transistor, GPS TX fixed at 2.XX V and PIC RX fixed 5V.
I don't know why this connection 'stuck' the signal.


Try put another 330 ohms between the B and E of first 2N2222. The voltage at logic 0 there might be too high and made it saturate.

You can also replace 2N2222 with DTC114ES or DTC144ES if you still can get them. They are transistors with resistors built in.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Connect LVTTL to PIC

Postby shahrul » Sat Mar 17, 2012 11:34 pm

@Robosang, the code is typo error, because that is not actual code. The code I use is, I'm using UART Interrupt. If receive UART, I set a flag byte. At main, I detect this flag and do the next.
Then, I will try your suggestion GPS >> Transistor >> UC00A

@Allen, that soldering not so hard. I always do that and take fast time (1 day while surfing internet, forum and facebook :) )
I will try your suggestion to add higher resistor value.

Other method I will try opto isolator 4N25.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 0 guests