RS232 comms - need help with datasheet


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default 12Mhz xtals arrived

    Quote Originally Posted by Acetronics View Post
    Hi, Malc



    Just try

    - a 12Mhz Xtal in HS PLL mode with 48 Mhz as a DEFINE



    Code:
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    DEFINE HSER_SPBRG 25  ' 115200 Baud @ 48MHz, 0.16%
    SPBRGH = 0
    BAUDCON.3 = 1         ' Enable 16 bit baudrate generator


    Alain
    Guys,

    12 Mhz crystals arrived today, and using the above now have RS232 coms. Compared to the prototype running with a 20Mhz crystal and the HS_PLL setting, the PIC seems to run a little slower (didn't think you could actually overclock these PICs ) - but I can live with that. I much rather have the option of communicating with a PC over a little bit of speed.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by malc-c View Post
    Guys,

    12 Mhz crystals arrived today, and using the above now have RS232 coms. Compared to the prototype running with a 20Mhz crystal and the HS_PLL setting, the PIC seems to run a little slower (didn't think you could actually overclock these PICs ) - but I can live with that. I much rather have the option of communicating with a PC over a little bit of speed.
    Hi, Malc

    Good settings always work fine ...

    BTW you also could have ordred some 16 Mhz Xtals ... just to test the behaviour.

    AND ... using analogic sensors could have permitted to try some " exotic " frequencies ( in the 12 -16 Mhz range, but not corresponding to a PBP define )

    [Humour ON]
    Or you could have rewritten your program for a compiler the same origin as your testboard ... ( Xtal frequency can be freely chosen )
    [Humour OFF]

    Glad it works fine ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default Stumped !!!! - Murphys (sods!) law strikes again

    Uhmmm... this was working fine, disconnected the comms lead from the EasyPIC5 board, now nothing is displayed in hyperterminal when the cable is re-connected. - Errr

    Have re-compiled and re-loaded the version of code I was working on, have even opened an earlier version and corrected the definds in that, compiled and tried again.... still no joy.

    Either cable is damaged, com port on the PC damaged, or max chip on the Easy PIC is damaged. - To disprove that I installed the old 16F877A which still contained the development code (prior to porting to the 18F chips) and 20Mhz xtal - hyperterm displayed the data correctly - so cable, ports and max chip obviously works.

    So with the power off I removed the 16F877A and installed the 18F4580, swapped the xtal back to the 12Mhz and then powered on (with hyperterm still "connected") and presto - works fine.......

    Stumped !!!!!!!!

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    4580 and code is good.
    PC and cable is good.

    Maybe hyperteminal is acting up? Try the Serial Communicator in MCS?
    Maybe the dev board has something loose? Try bread board?
    Dave
    Always wear safety glasses while programming.

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