PIC18F4550 to 18F4553 Comm Issue?


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Location
    Boise, Id
    Posts
    44


    Did you find this post helpful? Yes | No

    Smile Re: PIC18F4550 to 18F4553 Comm Issue?

    Thought I give an update. I did get the communication working at 115200 using the 24 Mhz clock setting. But then my DT interrupts timer was running 20 % fast (24/20). If enable the HSPLL it seems PLL becomes my primary clock, my understanding is the FOSC3:FOSC0 and OSCCON would select the primary oscillator if set? So I guess I'm not reading the data sheet correct or just not getting it set correct.

    To keep DT timer correct I changed to _FOSC_HS_1H and _CPUDIV_OSC1_PLL2_1L to disable the PLL. DT interrupts are timing correct again.

    Then I changed communication settings to
    Code:
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h  'External Clock, Enable transmit, BRGH = 1
    DEFINE HSER_SPBRG 10 ' 115200 Baud @ 20MHz, -1.36%  
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically  
    BAUDCON.3 = 0        ' BRG16 = 0
    The OSC define is set to 20. Communication and timing is all working correct again.

    As a side note, since I couldn't get Define OSC 24 to work I tried frequencies from the list
    2.3.1 DEFINE OSC
    There are a limited number of valid numbers that can be used: 3 (3.58MHz), 4, 8,
    10, 12, 16, 20, 24, 25, 32, 33, 40, 48, 64
    The frequencies that didn't cause an error are; 4, 8, 12, 16 and 20. The others give me an error of frequency not defined or previously used. Not sure what's causing that?

    I'm still not sure why the Clock/frequency/PLL configuration settings on the 4550 work, but on the 4553 I needed to change _FOSC_HS_1H and _CPUDIV_OSC1_PLL2_1L to keep DT clock running at 20Mhz and Communications clocking at 20 Mhz? The circuit board setup is the same, crystal is the same, same DT interrupts loading etc. The thing that isn't the same is the 4550 is programmed with a boot loader, and the 4553 I'm programming with PicKit 3. I wonder if the boot loader was changing some of the configurations on the 4550 in the background that I wasn't setting?

    Anyway, I'm up and running, thanks for the help! Let me know if you have any more insight that would help me get unconfused.
    Thanks
    Shane

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: PIC18F4550 to 18F4553 Comm Issue?

    I wouldn't be surprised if either the bootloader or the Pickit 3 was overriding your config fuses.

    But I've never used either.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  3. #3
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: PIC18F4550 to 18F4553 Comm Issue?

    The thing that isn't the same is the 4550 is programmed with a boot loader
    You probably should have mentioned that in post #1.

    Most bootloaders won't allow you to reprogram the CONFIG section (since that will likely break the bootloader), while the PICkit3 will load whatever you've set in the hex file.

  4. #4
    Join Date
    Apr 2009
    Location
    Boise, Id
    Posts
    44


    Did you find this post helpful? Yes | No

    Smile Re: PIC18F4550 to 18F4553 Comm Issue?

    I defiantly would have mentioned Pickit vs bootloader if I thought that would have anything to do it. I thought they would program what ever I had configured. Sounds like that may not be how the boot loader works though? Good to know.

    Thanks

  5. #5
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: PIC18F4550 to 18F4553 Comm Issue?

    It depends on the bootloader you're using... some will, some won't, so it's worth checking.

    It's usually a good idea NOT to allow the config to be reprogrammed. For example, if you goof up/change the osc setting you can easily turn your board into a brick.

Similar Threads

  1. RS232 comm
    By longdw in forum Serial
    Replies: 9
    Last Post: - 15th September 2009, 04:13
  2. trade 18F4553-I/P (really want 16c717/JW)
    By nomad in forum Adverts
    Replies: 2
    Last Post: - 1st November 2008, 23:49
  3. Code Issue - select case or 'if' issue - not sure why
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2007, 09:52
  4. serial comm problem
    By win_832001 in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 29th June 2006, 14:57
  5. Serial comm Problems
    By Fossil in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th January 2004, 03:29

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