strange problem ! pic18f4550 & pic16f84a serial communication .


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Hi,

    not sure if your Oscillator is set to the correct frequency. 20MHz; should this not be 48MHz? Are you defining the configs correctly for use with PLL?

    For a 20MHz crystal I use these:

    Code:
        'Config1L
    '    Full-speed USB Clock Source Selection: Clock Source from 96MHz PLL/2
    '    CPU System Clock Postscaler: Prescaler Divide by 5 for 20MHz Crystal
    '    96MHz Prescaler: Divide by 5 (20MHz Input) 
    @ __CONFIG _CONFIG1L, _USBDIV_2_1L & _CPUDIV_OSC1_PLL2_1L & _PLLDIV_5_1L
    
        'Config1H
        'Oscillator: HS oscillator, PLL enabled, HS used by USB
        'Fail-Safe Clock Monitor Enable: Enabled
        'Internal External Switch Over Mode: Disabled
    @ __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEM_ON_1H & _IESO_OFF_1H
    Cheers

    Rob

  2. #2
    Join Date
    Jun 2007
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    thanks for reply , but when i paste this code i get an error .

    and am sure i setup it to correct frequency .

    error :
    overwriting previous address contents (0000) .
    symbol not previously defined (_fcmem_on_1h) .

    regrads .

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by amenoera View Post
    error :
    overwriting previous address contents (0000) .
    symbol not previously defined (_fcmem_on_1h) .
    I've seen this before somewhere. Don't remember what the deal was.

    Do a search on fcmem and fcmen.
    Should fix you up...

    EDIT: Found it...
    Old versions of MPLAB use FCMEM, new one uses FCMEN

    http://www.picbasic.co.uk/forum/show...m+fcmen&page=3
    Post #82

  4. #4
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by amenoera View Post
    thanks for reply , but when i paste this code i get an error .
    and am sure i setup it to correct frequency .
    Skimask has given you the answer for the error but the frequency will need to be defined as 48MHz when you correct to FCMEN instead of FCMEM. This is because the config settings I have given you set the PIC to run from 48MHz PLL clock source which is generated by the PIC internally but using your 20MHz crystal as the original clock source.

    Hope this helps. Let us know how you get on.

    Cheers

    Rob

  5. #5
    Join Date
    Jun 2007
    Posts
    25


    Did you find this post helpful? Yes | No

    Thumbs up

    woow , yes you are right .

    all i did is :

    1 : for this "symbol not previously defined (_fcmem_on_1h) " error , i changed it

    to "(_fcmen_on_1h" .

    2 : i comment this lines in "18f4550.inc" in my "pbp" folder :

    ; __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    ; __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H

    this 2 line is reponsable for this erro "overwriting previous address contents (0000)"

    3 : i change "define osc 20" to "48" .

    after that , all works fine , and i can now send and recive without any problems .

    thanks again .

    regards .

  6. #6
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Smile

    Excellent,

    glad it's working for you!

    Kind regards

    Rob

Similar Threads

  1. Serial Communication Using PIC16F84A
    By fazan83 in forum GSM
    Replies: 9
    Last Post: - 22nd January 2007, 02:56
  2. Serial Communication Problems (Strange!!)
    By Armando Herjim in forum Serial
    Replies: 1
    Last Post: - 20th June 2006, 22:46
  3. Replies: 5
    Last Post: - 20th March 2006, 01:34
  4. Serial Communication Problem
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 23rd February 2006, 02:11
  5. Replies: 8
    Last Post: - 11th November 2004, 20:08

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