Hserout


Closed Thread
Results 1 to 12 of 12

Thread: Hserout

Hybrid View

  1. #1
    Join Date
    May 2015
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Hserout

    Still the same. Maybe I don't configured something?

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,642


    Did you find this post helpful? Yes | No

    Default Re: Hserout

    you might have a rmw issue

    try this


    Code:
    #CONFIG
        __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _BODEN_OFF  & _PWRTE_OFF
    #ENDCONFIG
    DEFINE OSC 4
    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50
    DEFINE SER_BAUD 2400 
    DEFINE SER_CLROERR 1
    
    CMCON = 7 : TRISIO = %00010001 : ADCON0.7 = 1 : ANSEL = %00011001
    INCLUDE "modedefs.bas"
    
    LED var GPIO.2
    i var byte
    Akumuliatorius VAR word
    Lygis var word
    Buves var word : Buves = 0
    Buves1 var word
    Buves2 var word
    
    Adr1 var byte : Adr1 = %00111110
    Adr2 var byte : Adr2 = %01101110
    CMD1 VAR BYTE : cmd1 = %10111110
    CMD2 var byte : cmd2 = %10011100
    pause 100
    
    FOR i = 1 TO 3
    high led : pause 400
    low led : pause 400
    NEXT i
       
    main:
    ADCIN 0, akumuliatorius
    
    if akumuliatorius <= 640 then
    high led
    else
    low led
    endif
    gpio.0=1
    adcin 3, lygis
    
    Buves1 = Buves - 4 : Buves2 = Buves + 4
    
    if Lygis <= Buves1 or Lygis >= Buves2 then
    buves = lygis
    SEROUT GPIO.1,T2400,["*",Adr1,Adr2,Lygis,CMD1,CMD2]
    endif
    
    goto main
    end

Similar Threads

  1. HSEROUT Disable
    By Dick Ivers in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th January 2012, 23:50
  2. HSEROUT problem
    By karlosguay in forum Serial
    Replies: 3
    Last Post: - 11th January 2012, 19:44
  3. Hserout
    By Andre_Pretorius in forum Serial
    Replies: 3
    Last Post: - 7th June 2007, 04:45
  4. Hserout
    By MICOCALI in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 7th August 2004, 18:08
  5. HSEROUT and 16F628A
    By fredblah in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th May 2004, 00:07

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