DEBUG baud rates


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2003
    Posts
    41

    Default DEBUG baud rates

    What is the maximum reliable speed that a PIC16F88 can bi-directionally communicate with a PIC16F877A when both have 20 MHz crystals? The manual says DEBUG is the smallest and fastest comms routine but fails to mention anything about the maximum data rates.

    I need reliable comms between four PICs on the same PC board. They all run at 20 MHz.

    I cannot use the USART as this is reserved for debugging and I have experienced startup problems when two PICs, both running bootloaders, are joined together via the hardware USART

    Cheers
    Brian.

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251

    Default

    Normally I use a baudrate of 9600. With no problems on comunication.
    And when the 4 ic's are on the same printed circuitboard use then shiftin/ shiftout for communications betweem them. It's fast and reliable.
    Last edited by mat janssen; - 22nd January 2006 at 10:09.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    DEBUG must work up to 115200 @20MHZ without too much problem. i'd never tested it higher than 115200, maybe it work, maybe not.

    What kind of problem did you have ?

    How it was connected?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Feb 2003
    Posts
    432

    Default

    Quote Originally Posted by mat janssen
    And when the 4 ic's are on the same printed circuitboard use then shiftin/ shiftout for communications betweem them. It's fast and reliable.
    Hi Mat,

    I am interested in inter PIC communications but something I cant see from the manual is how ShiftIn/ShiftOut would work.

    As I read it, both ShiftIn and ShiftOut DRIVE the clock signal. There doesnt seem to be an option to allow the clock to be external. It almost seems as if there should be a ClockIn/ClockOut command which was effectively the same bu used external clock, or just some added modes to the existing commands the set the clock pin as an input for external clock

    Could you please expand on how you have implemented the above idea.

    Regards
    Keith

    www.diyha.co.uk
    www.kat5.tv

  5. #5
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251

    Default

    Yes, ofcourse I know that. And it is also a problem of knowing if the other chip was ready for recieving data.
    That's why I used a HEF4731 in between. With oring the clock.
    I made also a line that i have data for my neighbour.
    When sending I write the data into the 64 bit register. And when the slave got a signal that I have data for him I read the 64 bit register.

    Serout and serin commands are also usable but I don't know what happens if the masterchip has to communicate at the same time with its hardware uart.

  6. #6
    Join Date
    Mar 2003
    Posts
    41

    Default FAST PIC to PIC comms

    Thanks for the insights guys. I will restate my problem.

    I have two PIC16F88 and two PIC16F877A on a single 100 mm square board. I have been using serin/out2 with the mode number set to 16390 which gives 38,400 bps. I use an RTS/CTS system to pace the communications and send every packet with a checksum. This has been a reliable means of communicating between the PICs but I now need it faster. I don't care what the speeds are as long as they are faster and preferably up around 100,000 bps.

    The boards are built and shiftin/shiftout traces are not on it. I also don't see how shiftin/shiftout can easily work in a peer to peer system. Shiftin/out needs a master to provide the clock. I cannot, or don't want to, use the USART HSERIN/OUT as this is reserved for the bootloaders and physically wired on the PCB to the bootloader ports. In a previous project I had intermittent trouble at startup with USART to USART comms where both PICs had MCSP bootloaders running. I think that on occasions the bootloaders would see each other and think mother was calling. They appeared to start a brief but merry dance between themselves and the system would then crash. The boot code was never overwritten thankfully.

    From a peek at the SERIN2 tables on the Melabs web site it seems that there are only certain speeds available to SERIN2. I don't know what happens if you just pick mode numbers at random but I doubt it will be pleasant.

    Because the baud rates are the result of some unknown (to me) math operations, and we have integer math divisor truncations, I am pretty sure there will be a few optimum and many sub-optimum baud rates with DEBUGIN and DEBUG. I don't care if the speeds are 'non-standard', I just want fast reliable comms.

    Does anyone have a table of preferred DEBUG/IN speeds similar to the SERIN/OUT2 speeds on the melabs web site or can they point me to an algorithm that computes this?

    Cheers
    Brian

  7. #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166

    Default

    btaylor, Why not use the HSERIN/OUT commands? That way you can use the full speed of the hardware UART. At 20 Mhz. crystal rate and SPBRG set to 1 with the BRGH bit set to 1 you should get about 125000 baud.

    Dave Purola,
    N8NTA

Similar Threads

  1. N-Bit_MATH
    By Darrel Taylor in forum Code Examples
    Replies: 38
    Last Post: - 16th December 2010, 14:48
  2. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  3. debug not working with MPASM assempler
    By santamaria in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th March 2009, 07:51
  4. Auto Baud Rate Detection
    By mytekcontrols in forum Serial
    Replies: 10
    Last Post: - 31st October 2005, 02:17
  5. Baud Rate and Timing Calculator
    By picnaut in forum General
    Replies: 3
    Last Post: - 23rd January 2004, 16:48

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