issue with serin and serout


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    sorry i should have included more of the code. i already took care of turning everything to digital and turning the comparators off. made no difference. as i said the PIC communicates properly between two pc's. i connected one pc to the serial interface i have setup for the pic and then i used another max233 to connect another pc to my porta input and out and was able to send bytes between the pcs without a problem.

    thanks,
    Jordan

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Looking back at your first post and I am still not clear on a few things.
    ECU to PC = YES
    PIC to PC = YES
    ECU to PIC = NO

    You may want to look at the PBP manual, I can not find 38400 as a baud rate and 6 is 9600 for SERIN/SEROUT.
    o btw the ECU operates at 38400 baud rate thast why theres a 6 there.
    Others have talked about using a PIC with an ECU, I have not done so, beyond basic serial com I can not help. So the best I can suggest at this point is to double check the baud rates and if the data is true or inverted.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2007
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    i was under the impression teh baud rate was simply a calculation, (1000000 / baud) - 20


    when i connected a PC to PORTA.0 and PORTA.1 it was able to send and recieve data at 38400 baud rate. actually now that u mention it, the one thing i DON't know is if the ECU wants the data true or inverted. i imagine true. how would i set it to inverted? the microcode reference suggests bit 14, but i'm confused how to set bit 14 ?

    thanks,
    Jordan

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Here is some info on Baud Rate. http://francis.courtois.free.fr/jc1/...BitFormat.html
    The formula you are looking at from the manual is for figuring bit time in microseconds.

    In the back of the manual, Appendix A, there is a table for SREIN2/SEROUT2.
    Code:
    SERIN2 PORT?.?,84,[your DATA]
    Will receive at 9600,Driven, True, no parity.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    You got it while I was replying.
    I do not think I was much help, Now I am confused
    Would you mind posting the code that works so maybe I can learn something?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Aug 2007
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Well, it turns out i was wrong.

    i only tested it for a few minutes this morning, and upon further inspection this afternoon it turns out, while i was recieving data, the data was completely inaccurate. im very confused. all i know is the ECU should talk at 38400 8N1. i've tried a LOT of combinations and i can't figure it out.

    thanks,
    Jordan

  7. #7
    Join Date
    Aug 2007
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    OK FINALLY GOT ITTT!!!!! WOO HOOO. forgot to connect a common ground! i am an idiot! btw - 6 works perfect for 38400 8N1!

    thanks for the help
    Jordan

Similar Threads

  1. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  2. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  3. Help with serin, serout, Manchester encoding
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 5th April 2007, 13:31
  4. Serial interface with RFID reader
    By brid0030 in forum Serial
    Replies: 8
    Last Post: - 23rd January 2007, 06:23
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

Members who have read this thread : 0

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