Serin serout problem


Closed Thread
Results 1 to 40 of 337

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    HI, NO I have not found the problem . I was about to order some pic16f648a, you told it worked with these chips.

    I tried your program , the No sync appears at every increment,
    so guess there is a problem with the trailer or leader bit.

    k

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    HI, NO I have not found the problem . I was about to order some pic16f648a, you told it worked with these chips.

    I tried your program , the No sync appears at every increment,
    so guess there is a problem with the trailer or leader bit.

    k
    I wouldn't order any '648's or '628's, the 'F88 should be just fine.

    What does the display read? Does it show the hardcoded 444 and 888? Did you try removing that? Also, get rid of the pauses in the receiver code, or at least drop them down a bit, cut them in half or so.

    JUST SAW THIS: In the transmit code, the trailer byte should be a $55, not $ff. That'll probably fix it now. The fact that you said it shows 'No Sync' at 'EVERY INCREMENT' is the key thing, it shows that the loop is going thru the SERIN commands now.
    Last edited by skimask; - 26th December 2006 at 19:18. Reason: fixing mistake in the transmitter side

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    The display never showed the 444 or 888.
    I posted a new picture.
    I tried removing the pauses, putting them at half the pause you had them, also changed the trailer byte to $55 ..same effect.
    Last edited by lerameur; - 26th December 2006 at 20:44.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    The display never showed the 444 or 888.
    I posted a new picture.
    I tried removing the pauses, putting them at half the pause you had them, also changed the trailer byte to $55 ..same effect.
    Ok, let's try the silly simple and build back up... I guess we gotta figure out where this whole thing is failing at. If this don't work......I dunno....


    'RECEIVE PIC

    INCLUDE "modedefs.bas"
    DEFINE OSC 20 'use external 20mhz crystal
    CMCON = 7 : ANSEL = 0 : ADCON1 = 7
    DEFINE LCD_DREG PORTA ' Set LCD Data port
    DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 0 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    DEFINE LCD_DATAUS 250

    temp var word : temp1 var word : input portb.2

    loop:
    serin portb.2 , t2400 , [ temp ]
    lcdout $fe , $80 , DEC3 temp
    temp1 = temp1 + 1
    lcdout $fe , $c0 , DEC5 temp1
    goto loop
    End











    'TRANSMIT PIC

    INCLUDE "modedefs.bas"
    DEFINE OSC 20 'use external 20mhz crystal
    CMCON = 7 : ANSEL = 0 : ADCON1 = 7
    DEFINE LCD_DREG PORTA ' Set LCD Data port
    DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 0 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    DEFINE LCD_DATAUS 250
    DEFINE CHAR_PACING 33333

    temp var byte : temp1 var word : output portb.2

    loop:
    temp = temp + 1
    serout portb.2 , t2400 , [ temp ]
    lcdout $fe , $80 , DEC3 temp
    temp1 = temp1 + 1
    lcdout $fe , $c0 , DEC5 temp1
    goto loop

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok, the sending pic increment both on line 1 and two
    the receiving end displays a constant 535 on the 1st line and 49102 on the second line


    problem still persist
    Last edited by lerameur; - 26th December 2006 at 22:23.

  6. #6
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok here it is :

    THIS DO NOT WORK;
    loop:
    serin portb.2 , n2400 , [ temp]
    lcdout $fe , $80 , DEC temp
    pause 200
    goto loop
    End



    THIS WORKS;;
    loop:
    serin portb.2 , n2400 , temp
    lcdout $fe , $80 , DEC temp
    pause 200
    goto loop
    End

    AS soon as I put the square brackt , the display is messed up

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    ok here it is :

    THIS DO NOT WORK;
    loop:
    serin portb.2 , n2400 , [ temp]
    lcdout $fe , $80 , DEC temp
    pause 200
    goto loop
    End



    THIS WORKS;;
    loop:
    serin portb.2 , n2400 , temp
    lcdout $fe , $80 , DEC temp
    pause 200
    goto loop
    End

    AS soon as I put the square brackt , the display is messed up



    You are abso-freekin-lutely right!!!!!!!!!! My fonts have been messed up this whole time on my pdf viewer!!!!!!!! In the PBP manual, it shows what looks like brackets around the 'item', when there really isn't any brackets!!!!!!! AND...when I looked at the project I was saying that worked just fine, it doesn't have brackets either!!!!!!! Freekin''''amazing....I should've caught this days ago!!!!!

    Let's go back, but not as far...
    Working on another post/program that should work 100% all the way this time.

    (damn, I could seriously kick my own ass right now)....
    I'll have it posted here in a few minutes...

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. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. serout and serin problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th April 2006, 19:44
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26
  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