Serout and 18F87J50


Closed Thread
Results 1 to 9 of 9
  1. #1

    Angry Serout and 18F87J50

    Hi,

    I need some help. I am trying to get the Serout and Hserout to work on the 18F87J50, I have download many sample code but I can’t get any to work, I am trying to talk to a PC, but I do not what to use a RS232 inverter, It says in the 18F87J50 data sheet, if you set the Bit to 14 and use 115200 then, can talk to the PC and do not need to use any MAX chip,

    Dus any one know how to do this, or how can find some code?


    Thanks
    Glenn

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Hello Glenn, and welcome to the forum!

    With the PIC18f87j50 you have a couple options.

    Normally hserout and hserin need a rs232 inverter.... But with that chip you can use the DTRXP: Data/Receive Polarity Select bit to invert your USART port. See http://www.picbasic.co.uk/forum/showthread.php?t=10361

    Or, you can use serout driven inverted.

    It would help us to know what you have so far, as far as config fuses, and code, as well as mhz, as all your serial settings will depend on this.

    Here is a calculator for finding the values to set for baud rate:
    http://www.picbasic.co.uk/forum/atta...achmentid=2957
    Last edited by ScaleRobotics; - 8th November 2009 at 17:59.
    http://www.scalerobotics.com

  3. #3

    Default Tusb3410

    Hi,

    First I must say thanks for the quick reply; I have try all speeds from 1200 to 115200 and every setting I can think of. ( Serout Portc.7, 9600, ( and all the rest ), “Hello” and all I get is junk at the PC. ( Unless I use a Max232 ), this is not what I’m looking for.

    The circuit is using an TUSB3410, it go’s like this the 18F87J50 pins C7 and C6 go to the TUSB3410 then to the USB on the PC, on the PC we have to use a Ver com port, so I think the problem is setting up the TUSB3410.

    Well thanks, if you know any one that has the same circuit and has it working let me know.

    Thanks
    Glenn

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Quote Originally Posted by Glenn_Webber View Post
    I have try all speeds from 1200 to 115200 and every setting I can think of. ( Serout Portc.7, 9600, ( and all the rest ), “Hello” and all I get is junk at the PC. ( Unless I use a Max232 )
    Well, you have not really shared many of your settings, or code. But that is promising that it is working with a max232! I assume that "tried Serout Portc.7, 9600, (and all the rest)" means you have tried Serout Portc.7, N9600 (N for inverted)?

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818

    Default

    Quote Originally Posted by Glenn_Webber View Post
    Hi,

    First I must say thanks for the quick reply; I have try all speeds from 1200 to 115200 and every setting I can think of. ( Serout Portc.7, 9600, ( and all the rest ), “Hello” and all I get is junk at the PC. ( Unless I use a Max232 ), this is not what I’m looking for.
    Hserout / Hserin exchange data TRUE. Serin/Serout may be true or inverted depending upon your selection of T or N example : T9600 or N9600. You may invert the Hserin with a simple transistor, it will not level shift like the max232, but will handle inverted data.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6

    Default 18F87J50 Help

    Hi,

    I need some help. This code works on the 16F690, but will not work on the 18F8722 or the 18F87J50. Can any one help me?

    16F690
    Pause 500

    Serout2 PORTB.5, 84, [$02]
    Serout2 PORTB.5, 84, [$61]
    Serout2 PORTB.5, 84, [$01]
    Serout2 PORTB.5, 84, [$22]
    Serout2 PORTB.5, 84, [$06]
    Serout2 PORTB.5, 84, [$00]
    Serout2 PORTB.5, 84, [$00]
    Serout2 PORTB.5, 84, [$00]
    Serout2 PORTB.5, 84, [$00]
    Serout2 PORTB.5, 84, [$05]
    Serout2 PORTB.5, 84, [$00]
    Serout2 PORTB.5, 84, [$00]
    Serout2 PORTB.5, 84, [$A0]
    Serout2 PORTB.5, 84, [$0A]
    Serout2 PORTB.5, 84, [$1B]
    Serout2 PORTB.5, 84, [$03]

    18F87J50 Not working
    Pause 500

    Serout2 PORTG.2, 84, [$02]
    Serout2 PORTG.2, 84, [$61]
    Serout2 PORTG.2, 84, [$01]
    Serout2 PORTG.2, 84, [$22]
    Serout2 PORTG.2, 84, [$06]
    Serout2 PORTG.2, 84, [$00]
    Serout2 PORTG.2, 84, [$00]
    Serout2 PORTG.2, 84, [$00]
    Serout2 PORTG.2, 84, [$00]
    Serout2 PORTG.2, 84, [$05]
    Serout2 PORTG.2, 84, [$00]
    Serout2 PORTG.2, 84, [$00]
    Serout2 PORTG.2, 84, [$A0]
    Serout2 PORTG.2, 84, [$0A]
    Serout2 PORTG.2, 84, [$1B]
    Serout2 PORTG.2, 84, [$03]

    The only biff is the port.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    If you have bit 7 in RCSTA2 set you can't use this pin.

    It's configured as the EUSART2 asynchronous receive, and can only receive serial data.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8

    Default Help

    Hi,

    The above is the full code, I'm new to all this stuff. How do I set the PIN's so I can use it for TX,RX?

    Thanks
    Glenn

  9. #9
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    Can you blink an LED on this pin using the 18F8722 or the 18F87J50?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts