Pulse Input > Array > Output help


Results 1 to 4 of 4

Threaded View

  1. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Pulse Input > Array > Output help

    longer delay cascading arrays upto 700ms


    Code:
    '****************************************************************
    '*  Name    : delayline.BAS                                     *
    '*  Author  : richard                                           *
    '*  Notice  :                                                   *
    '*          : All Rights Reserved                               *
    '*  Date    :                                                   *
    '*  Version : 1.0                                               *
    '*  Notes   : 16f1825                                           *
    '*          :                                                   *
    '****************************************************************
     #CONFIG
                 __config        _CONFIG1,    _FOSC_INTOSC & _CP_OFF & _WDTE_ON  &  _PWRTE_ON  &  _MCLRE_ON  & _CLKOUTEN_OFF
                  __config      _CONFIG2, _PLLEN_ON & _LVP_OFF            
    #ENDCONFIG
     
    OSCCON=$70 
    DEFINE OSC 32   ' Oscillator internal 
    ANSELA=0     
    ANSELC=0   ' Select no analog
    TRISA=%111111   
    TRISC=%001111   
    PulseArray0 var byte [32]  ' 1023 bits total this will allow delay of upto 700ms         
    PulseArray1 var byte [32]  
    PulseArray2 var byte [32]
    PulseArray3 var byte [32]
    tail var byte
    head  var byte
    Arraytail var byte
    clear
    Arraytail=0
    RunController:
    
    tail = Arraytail
    head =  tail+1
    PulseArray0.0[tail] = Porta.5  'set the last bit in the array as per b.0
    PulseArray1.0[tail]= PulseArray0.0[head]
    PulseArray2.0[tail]= PulseArray1.0[head]
    PulseArray3.0[tail]= PulseArray2.0[head]
    Arraytail  =   head 
    latc.4 = !latc.4 '    use p4 to check loop time on scope
    latc.5 = PulseArray3.0[head]  ' output this bit ~ 700ms delay
    pauseus 500  ;    adj to suit
    goto  RunController
    Attached Images Attached Images  
    Warning I'm not a teacher

Similar Threads

  1. Sharp pulse on ADC input and NAP
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 16th August 2011, 06:00
  2. How to reverse polarity on output pulse??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th June 2009, 13:25
  3. Input Output interface
    By aratti in forum Schematics
    Replies: 2
    Last Post: - 5th November 2008, 21:36
  4. input output code
    By pitufo in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th August 2008, 20:57
  5. Using 4 input to control 10 output
    By cibotsan in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th November 2004, 12:08

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