18F4550 XTAL Problem


Closed Thread
Results 1 to 7 of 7
  1. #1

    Default 18F4550 XTAL Problem

    Hi,

    I have a little Problem ,I have one 18F4550 Chip that running with a 20 Mhz Xtal.

    My Problem is that I can not find the Right setting to run my Software on that Chip.
    I need just a Normal RS232 Communication and not USB but I think that my settings are wrong!

    I have this:

    Define OSC 20
    OSCCON = %01111100
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG 64 ' 19200 Bauds
    DEFINE HSER_CLROERR 1
    UCON = %00000000
    RCSTA.7 = 1
    TRISC.7 = 1
    TRISC.6 = 1

    .......
    Hserout ..........
    .......
    End

    I have use SPRBG Calculator for the Baudrate (20 Mhz and 19200)

    But dont work I receive on my PC just wrong Data.

    Maybe some one can Help me to find the right Setting,I have experience with 18F452 and other PICs but with 18F4550 I dont understand what I make wrong .

    Thanks for any answer !

    Regards Pesti

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Hi,
    I have a little Problem ,I have one 18F4550 Chip that running with a 20 Mhz Xtal.
    My Problem is that I can not find the Right setting to run my Software on that Chip.
    I need just a Normal RS232 Communication and not USB but I think that my settings are wrong!
    ......
    But dont work I receive on my PC just wrong Data.
    Maybe some one can Help me to find the right Setting,I have experience with 18F452 and other PICs but with 18F4550 I dont understand what I make wrong .
    Thanks for any answer !
    Regards Pesti
    Do you have a MAX232 (or equivalent) in the circuit somewhere?

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Oh yes with max232 and other PIC 18F452 is working but with 18F4550 dont work I think that this is a Xtal setting Problem.

    Regard Pesti

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Oh yes with max232 and other PIC 18F452 is working but with 18F4550 dont work I think that this is a Xtal setting Problem.

    Regard Pesti
    Did you set HS instead of XT in the config's?
    Last edited by skimask; - 22nd January 2008 at 19:53.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Ok I think that I found the Problem,I have 20 Mhz Xtal but I must write Define OSC 48 while 20/5 = 4*24= 96 Mhz for PLL / Divider 2 = 48 Mhz CPU Clock.


    Thank You Skimask!

    Regards Pesti

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Ok I think that I found the Problem,I have 20 Mhz Xtal but I must write Define OSC 48 while 20/5 = 4*24= 96 Mhz for PLL / Divider 2 = 48 Mhz CPU Clock.

    Regards Pesti
    Ahhh...that makes sense.
    I thought you had a 20Mhz crystal and 20Mhz CPU clock.
    But, if that's the case, then your dividers (SPBRG) are going to be off also. Off the top of my head, I think 153 or 154 will do for SPBRG at 48Mhz CPU clock.
    I could be wrong...

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Yes You are Right I have for SPBRG 155.:-)

    Thanks

    Regards Pesti

Similar Threads

  1. Usart problem with 18F4550
    By maus in forum Serial
    Replies: 7
    Last Post: - 3rd November 2009, 03:54
  2. 18f4550 usb problem.. so im getting crazy..
    By MeSaKu in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th May 2009, 22:03
  3. 18f4550 portc.4 and portc.5 problem
    By pcaccia in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th October 2008, 20:52
  4. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  5. xtal problem.
    By Rhatidbwoy in forum mel PIC BASIC
    Replies: 6
    Last Post: - 28th October 2005, 01:50

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