picbasic +12c508a+soft_stack error


Results 1 to 37 of 37

Threaded View

  1. #20
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Nice work DT.

    Here's one at 13 words.
    Code:
      list      p=16F628A
      #include "P16F628A.inc"
      errorlevel  -302
      __CONFIG _CP_OFF & _BODEN_ON & _MCLRE_OFF & _WDT_ON & _PWRTE_ON & _LVP_OFF & _INTOSC_OSC_NOCLKOUT
    
       clrf  PORTB        ; clear port
       bsf   STATUS,RP0   ; Bank 1
       bcf   TRISB,0      ; RB0 = output
       bcf   OPTION_REG,0 ; 1:64 prescaler to WDT
    
    Left
       sleep             ; go to sleep for 64 * 18mS ~1 second
       rlf   TRISB,F     ; rotate bit across portb from lsb to msb
       btfsc TRISB,7    
       goto  Left
    	
    Right
       sleep          ; go to sleep for 64 * 18mS ~1 second
       rrf   TRISB,F  ; rotate bit across Portb from msb to lsb
       btfsc TRISB,0
       goto  Right
       goto  Left     ; now rotate back to the left.
    	
       End
    Last edited by Bruce; - 19th December 2007 at 18:17.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  2. Optimizing DIV
    By skimask in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd September 2008, 04:58
  3. pbp245 compliation error
    By Woodzy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 25th July 2006, 05:59
  4. 16F88 Compile error
    By Toley00 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 2nd November 2005, 00:22
  5. Compiler/Assembler Error
    By LT_Pic in forum General
    Replies: 7
    Last Post: - 21st July 2005, 09:47

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