Old analog guy needs help with PIC16F57


Closed Thread
Results 1 to 32 of 32

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    What Jumper said + you'll want to place DEFINE OSC 20 in the top section when using
    a 20MHz resonator. PBP assumes a 4MHz oscillator if you leave the define out.
    Regards,

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

  2. #2
    Join Date
    Jan 2009
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Still nothing.

    Is a Murata CSTLS20M0X53-B0 20 MHZ resonator suitable for this IC?

    I have the two outside leads connected to OSC1 and OSC2. The center pin is connected to ground.

    I checked continuity and everything appears to be OK. I also checked the LED and it functions OK.

    Here's the code that I tried:

    Code:
    @ device  pic16F57, hs_osc, wdt_off, protect_off
    
    DEFINE OSC 20
    
    main:
    TRISB=0
    here:
    PORTB=0
    Pause 2000
    PORTB=255
    pause 2000
    goto here
    
    end

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


    Did you find this post helpful? Yes | No

    Default

    Specs on the resonator look fine so it should work.

    I programmed one in-circuit this weekend with a PICKit2 and MeLabs USB programmer.
    Both worked fine.

    Do you have an external pull-up on /MCLR?

    Have you tried reading it back with your programmer to verify config settings?
    Regards,

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

  4. #4
    Join Date
    Jan 2009
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Reading back produces this in the code tab:

    Code:
    0000- 006c 002b 0cff 01eb 0703 01ec 0703 0a1f 
    0008- 0c03 002a 0ce7 090e 0a02 006a 0029 0cfc 
    0010- 01e9 026a 0703 0a1a 0cff 0000 01e9 0603 
    0018- 0a15 01e9 0004 03ea 0a14 0800 0003 04c4 
    0020- 04a4 0004 0800 0064 0683 0a31 0663 0a31 
    0028- 0213 0002 0217 0005 0218 0006 0219 0007 
    0030- 0800 0cff 0033 0037 0038 0039 0c1a 0036 
    0038- 0078 0040 0006 0066 0c07 002c 0cd0 0063 
    0040- 0901 0cff 0026 0c07 002c 0cd0 0063 0901 
    0048- 0063 0a3b 0063 091e 0063 0a4a 0fff 0fff
    Everything else is "0fff."

    The configuration tab produces:

    Code:
    0000- 0ffa
    I did not have MCLR pulled up, so I tried a 10k resistor. Still nothing.

  5. #5
    Join Date
    Jan 2009
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    I also tried a 4.7k and still nothing.

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


    Did you find this post helpful? Yes | No

    Default

    Are you disconnecting the programmer after programming, and running the PIC on its own power supply?

    You should also have a separate power supply for the PIC during ICSP. I.E. not trying to power it directly from the programmer.

    If you are, then try this.

    1. Program the part with your original .hex file.
    2. Read it back with your programmer, and save the .hex file with another name.
    3. Now open the new .hex file you just saved, and click the C box on the right.

    Does it show the correct config settings?
    Regards,

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

  7. #7
    Join Date
    Jan 2009
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    I'm not using ICSP. I made up an adapter cable to go directly from the programmer to the IC on a bread board.

    I'm then disconnecting the program cable and testing the IC with an external power supply.

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


    Did you find this post helpful? Yes | No

    Default

    Have you tried the read-back yet?
    Regards,

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

Similar Threads

  1. pic18f analog comparator problem
    By david.silaghi in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th May 2009, 10:38
  2. 16F88 Analog In
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 25th March 2008, 09:30
  3. Selection of analog ports
    By enauman in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th December 2006, 04:56
  4. Many Analog Inputs
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 10th July 2006, 09:15
  5. analog inputs on 16F716
    By schwinn_rider in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th October 2005, 05:07

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