serout out of order on 12F675


Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Apr 2008
    Posts
    5

    Angry serout out of order on 12F675

    IŽm trying to send data from PIC to BS2 via serout2 but the values are sistematically been altered.

    The 12F675 is generating the sequence:
    0,1,2,3,4,...,255

    And the BS2 is receiving:
    128,129,130,131, ... , 157,158,159,128, 129,130,...

    I verified and OSCCAL was not erased.
    Things got better when i include the line:

    Define OSCCAL_1K 1

    on the code, but the problem did not dissapear at all.

    here are the codes:

    12F675 code:
    Code:
    include "bs2defs.bas"
    Define OSCCAL_1K 1 ' Set OSCCAL for 1K Device
    
    ANSEL=%00000000
    CMCON=%00000111
    
    Trisio = %11111111 ' Set all ports as inputs
    Trisio.4 = 0 ' Set port GP4 as output
    
            saida    CON 4     
     
            i var byte
           
            pause 1000
    loop:
            for i = 0 to 255
                 serout2 saida,16780,[i]
                 pause 100
            next
    
            pause 2000
            goto loop
            end
    The BS2 code:
    Code:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    entr      PIN  1
    entr_mode  CON  16780   'entrada baudmode = 2400/8N1 INV
    PAUSE 10
    
    p VAR Byte
    
    Start:
    SERIN entr,entr_mode,[p]
    DEBUG DEC p,"  "
    GOTO Inicio
    Seems to me that is some timing problem. I overnight on this problem without a solution. I must be missing something trivial, but I cant figure out what!

    IŽll appreciate any help
    Last edited by Ricardo; - 28th April 2008 at 04:38. Reason: I made a mistake on first typing

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. 12f675 Serout Int_Osc problem
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th April 2007, 09:39
  5. Keypad unlock (as in garage door possibly)
    By Fred in forum Code Examples
    Replies: 5
    Last Post: - 2nd April 2006, 04: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