Announcement

Collapse
No announcement yet.

D Stick debug baud rate fixed at 2400?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • D Stick debug baud rate fixed at 2400?

    I have a D stick that I was setting up to communicate with hyper terminal. I used debug and debugin commands and defined the baud rate at 2400. It worked as I expected.
    Then I tried to get the operation to work at 1200 baud and 9600 baud. Each time redefining the baud rate with the define DEBUG_BAUD 1200 or DEBUG_BAUD 9600 statements.
    The D stick appeared to be fixed at 2400 baud regardless of the define statements telling it to setup at the different baud rates.
    Using the same pins E.0 and E.1, I changed my program to use serin and serout with specified baud rates of 1200, 2400 & 9600. That all worked correctly for each of the baud rates.
    When I returned to the program to use debug and debugin the baud rate again remained at 2400. It appears that the define baud statement is irrelevant and the debug command only works at 2400?
    So what am I missing in changing the baud rate when using the debug and debugin serial commands? Why does it appear to default to 2400?
    Thank you for your help,

  • #2
    This shouldn't be the case, but I'll test. It will help if you post example code.

    The D-Stick is wired so that HSERIN/HSEROUT are the preferred serial commands.
    Charles Leo
    ME Labs, Inc.
    http://melabs.com

    Comment


    • #3
      Hello Charles this is the entire program, I assume you wanted it all. The Debug and Debugin Baud rates were changed and I left the serin and serout command lines as comments, When enabled they seemed to work OK.

      #CONFIG
      ; set CONFIG1 for internal oscillator
      __config _CONFIG1, _FOSC_INTOSC
      ; set CONFIG2 for int osc pll controlled by OSCCON register,
      ;low-voltage programming on
      __config _CONFIG2, _PLLEN_OFF & _LVP_ON
      ; see file PIC16F1937.INFO (in PBP installation) for more options
      #ENDCONFIG

      OSCCON = %01111000 ' Set internal osc to 16MHz
      ANSELA = %00000000 ' PortA all digital
      ANSELB = %00000000 ' PORTB ALL DIGITAL
      ANSELD = %00000000 ' PortD all digital
      ANSELE = %00000000 ' PortD all digital

      TRISA = %11111111 'PORT A ALL INPUTS
      TRISB = %11111111 'PORT B ALL INPUTS
      TRISC = %00000000 'PORT C ALL OUTPUTS
      TRISD = %11111111 'PORT D ALL INPUTS
      TRISE = %11111111 'PORT E ALL INPUTS
      C VAR BYTE
      D VAR BYTE
      DEFINE OSC 16 ' Tell PBP that the device will clock at 16MHz
      DEFINE DEBUG_REG PORTE
      DEFINE DEBUG_BIT 0
      DEFINE DUBUG_BAUD 1200
      DEFINE DEBUG_MODE 1
      DEFINE DEBUG_PACING 1
      DEFINE DEBUGIN_REG PORTE
      DEFINE DEBUGIN_BIT 1
      define DEBUGIN_BAUD 1200
      DEFINE DEBUGIN_MODE 1
      Include "modedefs.bas"

      mainloop:
      D = PORTD ' READ PORT D
      PAUSE 10 ' WAIT for .01 seconds
      DEBUG D

      'serout PORTE.0, N1200, [D]
      PAUSE 10 ' WAIT FOR .01 SEC
      DEBUGIN 1000, mainloop,[c]
      'SERIN PORTE.1, N1200, 1000, mainloop, c
      pause 10 ' WAIT FOR .01 SEC
      PORTC = c ' OUTPUT C TO PORT C
      PAUSE 10 ' WAIT for .01 seconds
      GOTO mainloop ' Go back to loop

      Comment


      • #4
        Noticed a misspelling in the code:

        DEFINE DUBUG_BAUD 1200 (DUBUG instead of DEBUG)

        Is that the problem?
        Charles Leo
        ME Labs, Inc.
        http://melabs.com

        Comment


        • #5
          Yes indeed, it now works nicely at 1200 and 9600. I suppose I was relying on the PBP3 to flag miss spellings, I will have to be more careful. Sorry for your trouble.
          Thank you again for your prompt response.

          6802TK

          Comment

          Working...
          X