ICSP not recognizing..


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108

    Default ICSP not recognizing..

    Hello..

    I've implemented the ICSP and it's working really fine.. BUT, the winpic800 do not recognize the 16f877 at the second time, neither at the thirty... I got to remove pic from the board, disconnect the device and restart.... then it works...

    Have anyone the idea of what is going on?

    Thanks in advance..
    Sylvio,

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Is the software set up to erase before programming?
    And what are you doing with MCLR?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Yeap..

    I always erase pic after programming and MCLR is tied like this:

    VCC-10K-1N4148-MCLR-VPP(ICSP)

    Thanks!!
    Sylvio,

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Does it always work the first time?
    Try adding capacitors between VDD and VSS. As close as you can to the PIC on both sides. I had a similar problem once with the PICSTART and an 18F'r. ???
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Well, I've tried that too... same thing..

    Sometimes it works on the second try... i do not know..

    Well, got another problem, could you help again???

    I'm trying to make TMR1 interrupt at 36kHz.

    It uses a 20Mhz crystal... The code is below:

    Code:
    @ DEVICE pic16F877, HS_OSC ; System Clock Options
    @ DEVICE pic16F877, WDT_OFF ; Watchdog Timer
    @ DEVICE pic16F877, PWRT_ON ; Power-On Timer
    @ DEVICE pic16F877, BOD_OFF ; Brown-Out Detect
    @ DEVICE pic16F877, CPD_OFF ; Data Memory Code Protect
    @ DEVICE pic16F877, PROTECT_OFF
    
    define OSC 20 
    
    INT       VAR     PIR1.0  ' OVERFLOW flag
    START   VAR     T1CON.0 ' START TMR1
    LOAD     VAR     word
    
    '------- Configurações iniciais -------------------- 
    TRISA  = %00000000 ' PORTA
    TRISB  = %00000000 ' PORTB 
    TRISC  = %00000000 ' PORTC
    TRISD  = %00000000 ' PORTD 
    TRISE  = %00000000 ' PORTE 
    
    INTCON = %11000000  ' enable global interrupt
    OPTION_REG = %00000000
    ADCON1 = %10001111  ' all digital
    T1CON = %00000000   ' TMR1 1:1 prescaler
    PIE1 = %00000001    ' Henable  TMR1 INT
    START = 0
    INT = 0
    LOAD = 65404 '  INT. 36KHz
    '--------------------------------------------------- 
    ON INTERRUPT GOTO SINUS
    
    TMR1L = LOAD.lowbyte
    TMR1H = LOAD.highbyte
    START = 1 
    PORTB.0 = 1
    MAIN:      
            GOTO MAIN    
    
     
    DISABLE
    SINUS:  INT = 0
               TMR1L = LOAD.lowbyte
               TMR1H = LOAD.highbyte
               PORTB.0 = 1 ' JUST TO MEASURE THE FREQ. ON OSCILLOSCOPE
               PORTB.0 = 0
    RESUME
    ENABLE
    
    end
    The oscilloscope do not shows 35.9kHz, but 30~33kHz...

    Anything I can do?

    Thanks again!
    Sylvio,

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    make sure you also disable the LVP mode. This pin have to be loaded to GND when progaming.


    And then... when you reload a 16Bit timer you want to add the reload value instead of just dumping the values in. Finally you want to stop it, then add the reload value, the restart the timer.

    Depending how accurate you want it, not a bad idea to switch to Darrel's instant INTs (PBP or ASM... where asm is always handy .. )
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Try this and see what happens, should give you a 50% duty cycle ~36khz square wave on your o'scope:
    Code:
    @ DEVICE pic16F877, HS_OSC ; System Clock Options
    @ DEVICE pic16F877, WDT_OFF ; Watchdog Timer
    @ DEVICE pic16F877, PWRT_ON ; Power-On Timer
    @ DEVICE pic16F877, BOD_OFF ; Brown-Out Detect
    @ DEVICE pic16F877, CPD_OFF ; Data Memory Code Protect
    @ DEVICE pic16F877, PROTECT_OFF
    DEFINE OSC 20
    load con 65468:intcon=$c0:option_reg=0:adcon1=$87:t1con=1:pie1=1:c var byte
    goto main
    ON INTERRUPT GOTO SINUS
    TMR1L=LOAD.lowbyte:TMR1H=LOAD.highbyte
    MAIN:      GOTO MAIN    
    DISABLE
    SINUS: if pir1.0=1 then
              pir1.0=0:tmr1l=load.lowbyte:tmr1h=load.highbyte:c=c+1:portb.0=c.0
              endif
    RESUME
    ENABLE
    END
    And take note of Mr_E's note about adding values.

Similar Threads

  1. ICSP and 16F684
    By onaclov2000 in forum Schematics
    Replies: 4
    Last Post: - 5th March 2009, 17:31
  2. ICSP from EPIC to Breadboard && 16f88
    By rdxbam in forum General
    Replies: 2
    Last Post: - 14th December 2008, 20:13
  3. Soic Icsp
    By earltyso in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th September 2008, 19:51
  4. Replies: 1
    Last Post: - 10th December 2007, 23:57
  5. ICSP Programming from a PDA
    By Ralph in forum Off Topic
    Replies: 2
    Last Post: - 11th November 2007, 22:22

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