DT_Ints w/18F26K22 stop if incorrect baud rate


Closed Thread
Results 1 to 22 of 22

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: DT_Ints w/18F26K22 stop if incorrect baud rate

    and Henrik is right
    about this
    USE a HSERIN/HSEROUT statement in your code - which you don't. Try adding a dummy

    Code:
    #CONFIG
      CONFIG  FOSC = INTIO67
      CONFIG  PLLCFG = OFF
      CONFIG  PRICLKEN = OFF
      CONFIG  FCMEN = OFF
      CONFIG  IESO = OFF
      CONFIG  PWRTEN = OFF
      CONFIG  BOREN = SBORDIS
      CONFIG  BORV = 190
      CONFIG  WDTEN = ON
      CONFIG  WDTPS = 32768
      CONFIG  CCP2MX = PORTC1
      CONFIG  PBADEN = OFF
      CONFIG  CCP3MX = PORTB5
      CONFIG  HFOFST = ON
      CONFIG  T3CMX = PORTC0
      CONFIG  P2BMX = PORTB5
      CONFIG  MCLRE = EXTMCLR
      CONFIG  STVREN = ON
      CONFIG  LVP = OFF
      CONFIG  XINST = OFF
      CONFIG  DEBUG = OFF
      CONFIG  CP0 = OFF
      CONFIG  CP1 = OFF
      CONFIG  CP2 = OFF
      CONFIG  CP3 = OFF
      CONFIG  CPB = OFF
      CONFIG  CPD = OFF
      CONFIG  WRT0 = OFF
      CONFIG  WRT1 = OFF
      CONFIG  WRT2 = OFF
      CONFIG  WRT3 = OFF
      CONFIG  WRTC = OFF
      CONFIG  WRTB = OFF
      CONFIG  WRTD = OFF
      CONFIG  EBTR0 = OFF
      CONFIG  EBTR1 = OFF
      CONFIG  EBTR2 = OFF
      CONFIG  EBTR3 = OFF
      CONFIG  EBTRB = OFF
    #ENDCONFIG
      
      
            ;INCLUDE "modedefs.bas"
            ;INCLUDE"ALLDIGITAL.pbp"
            ;INCLUDE "HomeAutomationVars.bas"  'Open with PBP editor
            INCLUDE "DT_INTS-18.bas"     ; Base Interrupt System
            INCLUDE "ReEnterPBP-18.bas"     ; Include if using PBP interrupts
    
        define OSC 8
       
        DEFINE HSER_RCSTA 90h   'Hser receive status init
        DEFINE HSER_TXSTA 24h   'Hser transmit status init
        DEFINE HSER_BAUD 9600   'Hser baud rate
        DEFINE HSER_SPBRG 25
        DEFINE HSER_CLROERR 1
        
        DEFINE DEBUG_REG PORTB  
        DEFINE DEBUG_BIT 0
        DEFINE DEBUG_BAUD 9600 
        ' Set Debug mode: 0 = true, 1 = inverted
        DEFINE DEBUG_MODE 1
        x         var  word
        rxflag   var bit
        rxchar  var byte
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
     INT_Handler    RX1_INT ,    _read_serial,   PBP,  yes
     endm
     INT_CREATE             ; Creates the interrupt processor
    ENDASM    
    OSCCON = $60   ;  OSC 8
    @   INT_ENABLE   RX1_INT     ; enable external (RX) interrupts    
    debug "running",13,10 
    hserout "running",13,10     ;dummy
    Main:
        debug "."    
        for x = 1 to 1000
          if rxflag then
             Debug 13,10,"got !! asc chr",#rxchar,13,10
             rxflag=0
          endif 
          pauseus 1000
        next x 
         
    Goto main   
        
        
    read_serial:
        rxflag = 1
        rxchar = rc1reg  
    @   INT_RETURN
    Warning I'm not a teacher

  2. #2
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57


    Did you find this post helpful? Yes | No

    Default Re: DT_Ints w/18F26K22 stop if incorrect baud rate

    OK, Pic Basic Pro 2.6L will compile the project
    Version 2.60A gives these errors:
    Unknown Processor(18F26k22)
    Cannot open file (Include file "Pic18F26K22.inc" not found)
    Processor type is undefined


    Etc...
    Compiler Version 3.1.0.4 gives these errors
    Warning: Unable to open INCLUDE file DT INTS-18.BAS
    Warning: unable to open INCLUDE file REENTERPBP-18.BAS
    and a whole host of ASM errors associated


    Anyone have an idea of what to do now?

  3. #3
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57


    Did you find this post helpful? Yes | No

    Default Re: DT_Ints w/18F26K22 stop if incorrect baud rate

    I found that you need to point the Include to the location like,
    INCLUDE "C:\PBP\DT_INTS-18.bas"


    Mike

  4. #4
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: DT_Ints w/18F26K22 stop if incorrect baud rate

    Quote Originally Posted by Mike2545 View Post
    I found that you need to point the Include to the location like,
    INCLUDE "C:\PBP\DT_INTS-18.bas"


    Mike
    And to think I have like over 100 copies of DT_INTS[-18] because I made sure there was one in each folder I saved code in! That was worth the time spent reading this whole thing right there. Thanks Mike.

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: DT_Ints w/18F26K22 stop if incorrect baud rate

    If the file is in the PBP folder there's no need to specify the path. If no path is specified the compiler looks for the file in the source file folder, and then in the PBP folder.

    /Henrik.

  6. #6
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57


    Did you find this post helpful? Yes | No

    Default Re: DT_Ints w/18F26K22 stop if incorrect baud rate

    Henrik, apparently Pic Basic Pro 3 does not do that you need to specify the folder.

    Mike

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: DT_Ints w/18F26K22 stop if incorrect baud rate

    Mine works exactly as I describe, just tested it again....
    Place the file to be included either in source folder or in the root of the PBP3 folder and then doing INCLUDE "ThisOrThat.pbp" works just fine.

    If the file exists in BOTH locations it uses the one in the source file folder so that's where it looks first - as expected.

    /Henrik.

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