SEROUT2/SERIN2 Problem


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Darrel, point taken.

    Here is how I've set the configs (18F4525):

    DEFINE OSC 8


    OSCCON = %01110010
    CMCON = %00000111
    ADCON0 = %00000000 'Turn off A/D
    ADCON1 = %00001111 'Make All ports Digital IO
    TRISA = %00000000 'PortA is all outputs
    TRISB = %00000000 'PortB is all outputs
    TRISC = %00000000 'PortC is all outputs
    TRISD = %00000000 'PortD is all outputs
    TRISE = %00000110 'PortE.0 is output, 1 and 2 are inputs

    As I've said though it seems lots of experienced guys on this forum advise not to use asynch comms when relying on an internal clock that's why I made my last comment.

    Any further observations would be appreciated though,

    Thirsty

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by thirsty View Post
    As I've said though it seems lots of experienced guys on this forum advise not to use asynch comms when relying on an internal clock that's why I made my last comment.
    On a lot of the older chips with internal oscillators that is a valid statement. And I guess you could say that even on the new ones, when you consider the full temperature range, it's still a valid statement.

    But, when you're sitting in a room at somewhere close to 25°C, the internal oscillator of the 18F4525 will be within +/- 1%, which should be fine for asynchronous comms. So it doesn't really account for you're problem.

    Your register settings look good.

    Are you using any @ __CONFIG lines? Or just the defaults for PBP with a 4525?
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Try re-writing with out the str , something like
    from the manual
    SERIN2 1,16780,[WAIT(“A”),B0]
    Or better yet just send/receive a simple 5 and blink an LED to test the connection,

    I think the problem is in the way you are trying to receive the data. Take another look at SERIN2 in the manual, WAITSTR might be the answer.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Jun 2006
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Thanks guys.

    Darrel: I hadn't used any other config directives.

    The problem is that this setup will be used in an environment other than my office so it has to be reliable. I've decided to go the synch route and have gotten it working reasonably now.

    I've definately learned a lesson here though so it wasn't all a waste.

    I appreciate your help

    Regards

    Thirsty

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    WOW!

    You've written Synchronous Slave routines in 4 hrs (or less).
    I'm impressed, although skeptical.
    <br>
    DT

  6. #6
    Join Date
    Jun 2006
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    I didn't say I wrote it - I said I had it working. I found some sample code and used that as a basis.

    Sarcasm really is the lowest form of wit don't you think?

Similar Threads

  1. Problem with ASM IRQ using FSR0 on PIC18F252
    By mytekcontrols in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 11th March 2008, 20:48
  2. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  3. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  4. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59
  5. weird 12F629/675 problem
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th October 2004, 01:08

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