How to receive and analyze text via SERIN ?


Results 1 to 6 of 6

Threaded View

  1. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: How to receive and analyze text via SERIN ?

    Ok, this works, setup for a 16F690 demo board
    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF  
    DEFINE OSC 4
    
    DEFINE DEBUG_MODE  0    ' Debug sending True serial data
    DEFINE DEBUG_REG_PORTA  ' Debug Port = PortA as required by PICKIT2 serial Monitor
    DEFINE DEBUG_BIT 0      ' Debug.bit = PortA.0
    DEFINE DEBUG_BAUD 9600  ' Default baud rate = 9600
    DEFINE DEBUGIN_REG PORTA' Debug Port = PortA as required by PICKIT2 serial Monitor 
    DEFINE DEBUGIN_BIT 1    ' Debugin bit PortA.1
    DEFINE DEBUGIN_BAUD 9600' Default baud rate = 9600
    DEFINE DEBUGIN_MODE 0   ' Debugin receiving data true = 0 inverted = 1
    
    ANSEL=0
    ANSELH=0
    ADCON0 = 0
    ADCON1 = 0
    ;CCP1CON = %10001100 ;Dual PWM 10xx11xx P1A/RC5 P1B/RC4 RC3/AN7 RC2/AN6
    TRISA = %00000010           
    TRISB = %00000000           
                
    portC = 0
    TrisC = %00000000
    tank var byte[5]
    tank = 0
    
    
    
    main:
    debugin[str tank\5]
    PAUSE 30
    
    if (tank[0] = "H") AND (tank[1] = "A") AND (tank[2] = "M") AND (tank[3] = "E") AND (tank[4] = "X")THEN
    gosub flash
    
    debug " tank"," ",str tank\5
    else
    
    
                            
    
    debug " FAIL"
    endif
    
    
    goto main
    
    flash:
    portc.0 = 1
    pause 500
    portc.0 = 0
    pause 500
    return
    
    
    
    end
    If HAMEX is sent it flashes the led on portc.0, if anything else, is sent it responds with FAIL
    Last edited by Archangel; - 18th July 2014 at 18:07. Reason: else in text
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. DMX receive issue
    By NoahLD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th August 2014, 13:51
  2. How to prepare text (lots of text) for HSEROUT ?
    By Byte_Butcher in forum General
    Replies: 0
    Last Post: - 15th February 2010, 22:31
  3. Best way to receive RF bits
    By ruijc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st October 2008, 23:55
  4. receiver can not receive signal
    By nicolelawsc in forum Schematics
    Replies: 1
    Last Post: - 19th May 2006, 08:01
  5. Replies: 4
    Last Post: - 7th September 2005, 14:11

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