Serout problem


Results 1 to 40 of 95

Thread: Serout problem

Threaded View

  1. #31
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur
    ok here the code:

    Include "modedefs.bas"
    DEFINE OSC 20 '20Mhz Oscillator was used

    ADCON0 = 0 'AD MODULE OFF & CONSUMES NO CURRENT
    ADCON1=7
    CMCON = 7 'COMPARATORS OFF
    TRISB = %00000000 'PORTB OUTPUTS

    START:
    serout portb.2,n2400,[$AA]
    Pause 100
    GOTO START

    When I change the serout to serout2 , its worst. I am not getting a lot out the output pin, I also tried pin9 for output.

    I have a outpu 20Mhz crstal on port 15 and 16
    MCLR with a resistor to Vdd
    Vdd on 14
    ground on 5
    wire from 8 to input of TX module

    ken




    I see the problem right away. Remember when I said that the receiver needs to be trained (take a bit of time and read back there somewhere)? Well, you're sending one character, waiting 100ms, then sending another, waiting another 100ms...etc.
    That 100ms is WAYYYY too long. Change that pause to less than 5ms, and then look at your datastream at the receiver.

    Try this-----


    START:
    serout portb.2, n2400, [ $aa, $aa, $aa, $aa, $aa ]
    Pause 1
    serout portb.2, n2400, [ $0F, $F0 ]
    Pause 1
    GOTO START

    The 4 $AA's will take 16.6ms to transmit and probably won't match the transmitter output very well. Do not worry about that, it's ok, that's why we're training the receiver. It's completely normal.

    After a few cycles, the $0F and $F0 should be clearly visible and practically match the transmitter output (because we've trained the receiver). The $0F and $F0 will take about 8.3ms to complete, then there will be a 1 ms pause, then the sequence will start over.

    You should be able to see an obvious difference between the $AA's and the $0F and $F0.
    This should work just fine. Let me know what happens...
    JDG
    Last edited by skimask; - 1st December 2006 at 03:10.

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. Serout to serial servo
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 12th August 2009, 16:46
  3. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  4. Strange SerOut Problem
    By masosi in forum mel PIC BASIC Pro
    Replies: 39
    Last Post: - 23rd April 2007, 06:06
  5. Replies: 11
    Last Post: - 13th July 2005, 19:26

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