Help on PIC18F2585

Discussion in 'Embedded Systems and Microcontrollers' started by 101, Jun 2, 2008.

  1. 101

    Thread Starter New Member

    Mar 8, 2008
    5
    0
    Please can anyone help out with PIC18F2585? I'm trying to turn ON and turn OFF LEDs. I've written the code and compiled using MPLAB C18 C compiler and using MPLAB ICD2 debugger to program and debug the microcontroller. It doesn't set the PORTS (PORTB and PORTC) to Output. The when I tested the code on the PICDEM4 demo board where PIC18F1320 is used, it works well. The hardware seems ok and voltage readings on the VDD and /MCLR pin are OK, but very low voltage is read on the ports.

    Please find attached the sample code written in C.

    Thank you very much.

    Best Regards,
    101
     
  2. nanovate

    Distinguished Member

    May 7, 2007
    665
    1
    What speed are you running at?
     
  3. 101

    Thread Starter New Member

    Mar 8, 2008
    5
    0
    I'm using 14.7456MHz crystal

    Thanks.
     
  4. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    Read through the datasheet and figure out the pins on that ports that are multiplexed (if any) with other functions, such as analogue inputs, comparators, etc. Then try disabling those alternate functions to set the pins as digital I/O.
     
  5. 101

    Thread Starter New Member

    Mar 8, 2008
    5
    0
    Thanks. I got it working. It had to do with the settings on the MPLAB C18 Compiler.
     
Loading...