SERIN frustration


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jun 2012
    Location
    Australia
    Posts
    3

    Default SERIN frustration

    Trying to understand serial communications..
    The aim is to load a large number of 5 digit numbers into a serial eeprom from a PC.
    Step 1 is to master serial comms from PC.

    Using serial communicator (Microcode Studio tool) I send "1234", BUT LCD displays "Received = 3846"

    Any advice would be most welcome.

    My code..

    '**********************************
    @ device PIC16F877a , hs_osc, wdt_on, lvp_off, protect_off
    CLEAR
    DEFINE OSC 8

    DEFINE LCD_DREG PORTB ' Set LCD Data port
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 2
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 3 ' Set LCD Enable bit

    PortA = %00000000 'all outputs low
    PortB = %00000000 'all outputs low
    TrisA = %00000000 'All as outputs
    TrisB = %00000000 ' B.0 as input all others as outs
    TrisC = %11111111

    include"modedefs.bas" ' includes aliases for modes
    W0 var word
    B0 Var byte
    B1 var byte

    LCDOUT 254, 1 'Clear Screen
    pause 100
    LCDOUT 254, 1 'Clear Screen
    LCDOUT "W0 = " , dec W0
    pause 1000
    LCDOUT 254, 1 'Clear Screen
    mainloop:

    serin PortC.7,T2400,[] ,w0.lowbyte ,w0.highbyte

    LCDOUT 254, 1 'Clear Screen
    LCDOUT "Received =" , #W0
    pause 1500

    goto mainloop

    end
    '*******************************************

  2. #2
    Join Date
    Jun 2012
    Location
    Australia
    Posts
    3

    Default Re: SERIN frustration

    CORRECTION .. had terminal set to 1200..

    set terminal to 2400 - No Parity - Byte Size = 8 - No Stop Bit
    NOW displays "12849"

Similar Threads

  1. New user frustration (16F688 + LCD)
    By wcpesp in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 3rd February 2013, 17:52
  2. forum posting frustration
    By Heckler in forum Forum Requests
    Replies: 8
    Last Post: - 16th March 2012, 12:31
  3. how to use SERIN???
    By texas5 in forum Serial
    Replies: 4
    Last Post: - 23rd September 2008, 01:03
  4. Serin
    By Eyal in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th February 2007, 14:10
  5. serin
    By Sphere in forum Serial
    Replies: 2
    Last Post: - 28th August 2005, 19:43

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