DEBUG and 64 Mhz clock problem


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Posts
    39

    Default DEBUG and 64 Mhz clock problem

    Hello,
    does anyone tried to use serout command with 64 Mhz? I have PIC 18LF46K22 with 16 Mhz crystal osc and PLL x 4. So my internal freq. is 64 Mhz. The PIC has 2 hardware serial ports, they are working well. But I need to send something serialy on another pin - debug info and it doesn't work well - most of the characters are not readable. Here is my code:

    DEFINE OSC 64
    DEFINE DEBUG_REG PORTC
    DEFINE DEBUG_BIT 0
    DEFINE DEBUG_BAUD 9600
    DEFINE DEBUG_MODE 0

    DEBUG "GET /"
    for i=0 to 30
    DEBUG command[i]
    if (command[i] == $2F) then goto main
    next i

    I have on the PC the terminal with USB RS232 TTL converter. It is working well thus I can read the data from hardware serial port without problem. What I am receiving is:
    ) @¤TTP

    the get / which should be at the begining is wrong, these TTP characters are correct but the rest is wrong. I've tried to play with the speed to use e.g. 2400, also I've tried to use serout but no success.
    Has anyone idea, what to do? I am using PBP 2.60...

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: DEBUG and 64 Mhz clock problem

    Add the DEFINE DEBUG_PACING 1000 and see if it works.

    Cheers

    Al.
    All progress began with an idea

  3. #3
    Join Date
    Jan 2007
    Posts
    39


    Did you find this post helpful? Yes | No

    Default Re: DEBUG and 64 Mhz clock problem

    I have tried but it didn't help. This parameter is used for the pause between characters, if the receiving device is not able to manage the data. But it is not my problem. My problem is the fact, that the data are corrupted and I have a feeling, that it is because of the wrong implementation of the pbp. If I will use the 4 Mhz crystal and OSC 4, it works perfectly.

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: DEBUG and 64 Mhz clock problem

    Does it work also with the 16 MHz crystal and no PLL x 4 ?

    Al.
    All progress began with an idea

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: DEBUG and 64 Mhz clock problem

    If you try to make the output pin high at the beggining of the program?

    Ioannis

Members who have read this thread : 1

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