Receive serial data


Closed Thread
Results 1 to 19 of 19

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Another thing to try is just a plain DEC.

    DEBUGIN [DEC MyVar]

    DEC waits for a numeric character and discards anything else until it gets one. Once it receives a character that is a number, it continues receiving more digits until it gets a non-numeric char which would be the 13.

    This way the value can be any length, and you don't have to convert it to a byte.
    <br>
    DT

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel Taylor,

    will try your code too.


    [edit]never mind
    Last edited by ruijc; - 6th August 2008 at 23:31.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi all,

    just to let you know that it worked. I came across some issues but i managed to fix them.

    One of the issues was that i had to use a 10K pull down resistor between my logger and the new receiver.

    I kept a simple code and it works and no loss of data was found.

    here's the tryout code:

    Code:
    '****************************************************************
    'PINS
    
    n5 	var GPIO.5 
    n4 	var GPIO.4 
    BUT 	var GPIO.3 
    led     var GPIO.2 
    n1	var GPIO.1 
    IN   	var GPIO.0 
    
    '*****************************************************************************
    
    DEFINE OSCCAL_1K 1 
    define OSC 4
    
    '*****************************************************************************
    
    @ DEVICE pic12F675, INTRC_OSC_NOCLKOUT
    @ DEVICE pic12F675, WDT_OFF
    @ DEVICE pic12F675, PWRT_OFF
    @ DEVICE pic12F675, MCLR_OFF
    @ DEVICE pic12F675, BOD_ON
    
    '*****************************************************************************
    Include "modedefs.bas" ' Include serial modes
    
    DEFINE debug_reg gpio
    DEFINE debug_bit 1
    DEFINE debug_baud 9600
    DEFINE debug_mode 1
    
    DEFINE DEBUGIN_REG GPIO
    DEFINE DEBUGIN_BIT 0
    DEFINE DEBUGIN_MODE 1
    
    '*****************************************************************************
    ADCON0=0
    ANSEL=0
    CMCON=7   
    trisio=%00111001    
    GPIO=0
    
    '*****************************************************************************
    START:
    led=0
    if but=1 then
    goto rc
    else 
    goto start
    endif
    
    
    rc:
    led=1
    DEBUGIN [DEC VALUE]
    DEBUG dec VALUE,13,10
    goto rc
    
    end
    Thanks for the help

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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