PIC18F4550 help please


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Location
    Holmfirth England
    Posts
    116

    Default PIC18F4550 help please

    I have a problem using a PIC18F4550. Here is my code

    Code:
    DEFINE OSC 20
    'rcsta.7 = 0 tried turning usart off but not work
    store var byte
    number var word
    let number = 65531
    
    tx  var portc.6
    rx  var portc.7
    led1    var portd.0
    led2    var portd.1
    low led1
    low led2
    input rx
    high tx
    
    PAUSE 1000
    high led1
    serout tx, 2, ["Hello"]
    pause 500
    serout tx, 2, [#number]
    
    start:
    serin rx, 2, ["A"], store
    
    pause 1000
    low led1
    high led2
    
    serout tx, 2, [#store]
    
    pause 1000
    low led2
    high led1
    goto start
    
    end
    I am using a terminal program to test serial comms. If I compile for a pic16f871 it works fine, but compiled for a 18f4550 i just get garbage and the pic does not seem to receive anything.

    Can anyone tell me what i'm doing wrong please?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You might have the oscillator config options set to run the CPU at 48MHz.

    Try DEFINE OSC 48. If it works, that's the problem.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Replies: 18
    Last Post: - 4th July 2017, 14:26
  2. pic18f4550 & pic16f84a serially ?
    By amenoera in forum Serial
    Replies: 0
    Last Post: - 1st March 2008, 10:51
  3. The confi fuses for pic18f4550 in Epic programmer
    By sammy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th May 2006, 20:50
  4. Replies: 5
    Last Post: - 26th March 2006, 19:26
  5. pic18f4550 & VB6 ... help meee!!
    By lentz in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th March 2006, 17:27

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