Help With USB to Serial interface for a 16F88. What am I doing wrong?

Status
Not open for further replies.

wolwil

New Member
[SOLVED] Help With USB to Serial interface for a 16F88. What am I doing wrong?

Hello,

I have this circuit attached below and I can open hyperterm and hold the tx and rx of the FT232 and verify I am sending characters but when I try to get my PIC to read that character it does not see it.

Does anything look wrong with my circuit?

Here is my code for the PIC using PIC BASIC PRO:

Code:
 DEFINE OSC 4
 Include "modedefs.bas"

B0      var     byte

high PORTB.1

mainloop: Serin PORTB.2,N2400,B0
            If B0 = "b" Then
                Low PORTB.3 
            endif
            If B0 = "a" Then
                high PORTB.3       
            endif
Goto mainloop

Thanks
 

Attachments

  • Serial Test Schem&.jpg
    58 KB · Views: 1,360
Last edited:
Isn't the FT232R I/O already at TTL signal levels? If so, why would you need a MAX-232 level convertor?
 
Yeah thats what I thought too and I tried to just connect the TX from the FT232 to the SERIN of the PIC and that did not work...then after searching online I figured I needed a Max232 so I ordered them and now I hooked it all up and still nothing.

I'm stumped

So with the schematic I just attached not using the MAX232 it still does not work.
 

Attachments

  • Serial Test Schem&.jpg
    35.7 KB · Views: 341
Last edited:
OK I figured it out and I'm embarrassed to say that all I needed to do was to connect the Ground from the FT232 to the PIC's Ground (because its powered externally) and change the code to be True rather than inverted and then presto!!!

New Code with T2400 and not N2400:
Code:
 DEFINE OSC 4
 Include "modedefs.bas"

B0      var     byte

high PORTB.1

mainloop: Serin PORTB.2,T2400,B0
            If B0 = "b" Then
                Low PORTB.3 
            endif
            If B0 = "a" Then
                high PORTB.3       
            endif
Goto mainloop

So to clarify I didn't need the MAX232 at all.

Ah yes we live and we learn.

Thanks Mike for making me realize I was on the right track before I got the MAX232's by confirming what I had thought all along about what the FT232 does. Cheers!
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…