Serin and Serout problem


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: Serin and Serout problem

    Hello

    Transmitter and receiver do not need to operate at the same speed. They only have to use same baud rate. For instance, PIC and PC work at very different speeds yet they can communicate.

    As regards need for 20MHz oscillator for serial communication, I don't think that's correct. 4MHz is perfectly enough as long as you utilize adequate baud rates. Since it is a software serial communication, I would recommend not to exceed 2400 baud.

    Send some garbage first to "clear" comm-line and then transmit real data.

    It is good practice to apply pulling resistors, pull-downs in your case since you're using inverted mode.
    Also make sure that data line is not too long.

  2. #2
    Join Date
    May 2012
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: Serin and Serout problem

    Thanks grinder, I can now use an 18f2550 at 48MHz to receive the data sent by 12F675 at 4MHz and 9600 baud. I'll try to send the received data from 18F2550 to PC over USB using USBOUT command and write here if successful or not.

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


    Did you find this post helpful? Yes | No

    Default Re: Serin and Serout problem

    OKkkkkkkkkkkkay,
    DEFINE OSC 4, should always be all capital letters. In fact all defines should be, I understand the PB assembler is less fussy, but MPASM must be.
    Get used to using MPASM as your choice of assembler as PBP3 requires it, as does almost all of Darrel's tricks.
    The define does not actually set the oscillator speed, what it does do is adjust PBP timings so when you specify something like Pause 100 it actually generates the correct number of assembly nops to give you that 100 ms. Since I am not looking at the data sheet for the 12F675 understand I am winging it here, but as I remember the option Reg does set the OSC speed. As for can you use intrc or xt or HS with serout the answer is yes but with this caveat, the slower the OSC vs The BAUD rate the more likely the error will exceed the " I just can't understand what you're saying" level of the other chip. Obviously a crystal is closer to being on frequency followed by a resonator, and then internal / external R/C oscillator. Debug seems to work better than serin / out in R/C due to lower overhead going on in the background.
    Finally, if you are using a resonator of any frequency you should use the HS_OSC in your config. What this does is allow more power to run the OSC than the XT_OSC allows.

    HTH
    JS
    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.

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