Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ICD2 operating system

Status
Not open for further replies.
Gotta get that indent (space or tab) before, PS that version of the 16F877A was completly wrong, don't know how it slipped past me.
Although "org 0" works but it lazy coding(zero is zero in any base), org 0x000 is surefire (hex 000). if you want to use base 10 then put a decimal in front like this .0
Code:
;*** WDT reset toggles RB0
    list     p=16F877A
    include <p16F877A.inc>
    __CONFIG 0x3F7D
    org      0
    bsf      STATUS, RP0   
    movlw    b'00001110'
    movwf    OPTION_REG
    movlw    b'11111110'
    movwf    TRISB
    bcf      STATUS, RP0
    movlw    1
    xorwf    PORTB, f
    sleep
    end
 
Last edited:
as you can see i've sucessfully assembled ,several times , now something else ?

Code:
Connecting to MPLAB ICD 2
ICD0019: Communications:  Failed to open port: (Windows::GetLastError() = 0x2, 'The system cannot find the file specified.
')
ICD0021: Unable to connect with MPLAB ICD 2
MPLAB ICD 2 Ready
ICDWarn0034: Please ensure that your system's serial FIFO buffers are disabled.
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to MPLAB ICD 2
Target Device PIC16F877A found, revision = b4
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
...Erasing Part
ICD0152: Failed to read all of requested bytes (0x0 of 0x8)
ICD0275:  Programming failed.
MPLAB ICD 2 Ready
Programming Target...
ICD0082: Failed MPLAB ICD 2 operation
ICD0275:  Programming failed.
MPLAB ICD 2 Ready
Programming Target...
ICD0082: Failed MPLAB ICD 2 operation
ICD0275:  Programming failed.
MPLAB ICD 2 Ready
Programming Target...
ICD0082: Failed MPLAB ICD 2 operation
ICD0275:  Programming failed.
MPLAB ICD 2 Ready
Programming Target...
ICD0082: Failed MPLAB ICD 2 operation
ICD0275:  Programming failed.
MPLAB ICD 2 Ready
 
its 7.52

when i put the scope on the MCLR pin of my target , and press connect , it switches back and forth , a bunch if times , BUT it ends up at 0V , allways...
i have it set to power the target from the ICD2
shouldnt it end up at Plus 12V or so..? , after a reset ( i mean connect)

maybe i should power the target myself?
 
nothing on MCLR but the resistor.

Code:
MPLAB ICD 2 Ready
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
Target Device PIC16F877A found, revision = b4
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
...Erasing Part  <----------------****-------------!!!
ICD0152: Failed to read all of requested bytes (0x0 of 0x8)
ICD0275:  Programming failed.
MPLAB ICD 2 Ready

Bill you asked this before , i have no answer...
why is it erasing the part AFTER it programmed it?

sooo close yet so far
 
MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
...Erasing Part <----------------****-------------!!!
ICD0152: Failed to read all of requested bytes (0x0 of 0x8)
ICD0275: Programming failed.
MPLAB ICD 2 Ready

Think of programming the target as several steps
The 2nd step is to erase the part
Next it would actualy write the data

This is not a problem.
This is:
ICD0152: Failed to read all of requested bytes (0x0 of 0x8)

A few stabs in the dark...
I know we may have been over this again but how long is you ICD cable ?
If you are running 57600 try switching to 19200.
 
Last edited:
3v0 said:
Think of programming the target as several steps
The 2nd step is to erase the part
Next it would actualy write the data

This is not a problem.
This is:
ICD0152: Failed to read all of requested bytes (0x0 of 0x8)

A few stabs in the dark...
I know we may have been over this again but how long is you ICD cable ?
If you are running 57600 try switching to 19200.

the cable is about 7 inches long
it is the one that came with the kit , minus about three inches , 1.5" off either end.
what should the output look like? after a sucessfull build and program?


i can make the cable shorter if necessary..

19200 serial speed.
 
3v0 said:
Give a few minutes and I will generate one.

ok i will make the cable shorter in the meantime..

funny thing is the old programmer , would program a chip with a ten foot cable.
no kidding !
 
The build should end about like this(BUILD TAB). This was from a compiler not ASM as you are using, should be similar.
Memory usage: ROM=19% RAM=5% - 12%
0 Errors, 1 Warnings.
Loaded C:\CCS_SCHOOL\LCDtest\LCD_TST.cof.
BUILD SUCCEEDED: Tue Mar 06 18:34:26 2007


The build and program should look like this(ICD2 TAB).

MPLAB ICD 2 Ready
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
Target Device PIC16F877A found, revision = b4
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Resetting Target
Resetting Target
MPLAB ICD 2 Ready
MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x5E7)
...Loading DebugExecutive
...Programming DebugExecutive
...Programming Debug Vector
Verifying...
...Program Memory
...Debug Executive
...Debug Vector
...Verify Succeeded
Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Verify Succeeded
Connecting to debug executive
...Programming succeeded
06-Mar-2007, 18:36:54

MPLAB ICD 2 Ready
 
Last edited:
3v0 said:
The build should end about like this(BUILD TAB). This was from a compiler not ASM as you are using, should be similar.



The build and program should look like this(ICD2 TAB).
thanks for your help
mine connects fine
it reads fine
it blank checks fine
it doesn't erase.


another funny thing If I recall correctly
the 16F877A has a built in block erase command, which means you just give it the command to block erase , and the whole erase is automatic, timing is internal..

i got to go out for a bit be back later :)
 
Could be that the VPP voltage (12) is never getting to the VPP/MCLR pin on the target.

The instructions have you test for VPP at a testpoint. Are the transistors all installed the right way around ?

At this point I will defer to Bill in that he designed it.
 
3v0 said:
Could be that the VPP voltage (12) is never getting to the VPP/MCLR pin on the target.

The instructions have you test for VPP at a testpoint. Are the transistors all installed the right way around ?

At this point I will defer to Bill in that he designed it.

Actually it's based on the Stolz design, although if your scope shows 12v happens at the target MCLR pin then the VPP pullup transistors seem ok.

The ICD2 programs chips very fast, long cable lengths will cause problems. You also should have nothing else hooked up to PGC & PGD (RB6&7)

Do you have anything loading PGC & PGD?
 
blueroomelectronics said:
Actually it's based on the Stolz design, although if your scope shows 12v happens at the target MCLR pin then the VPP pullup transistors seem ok.

The ICD2 programs chips very fast, long cable lengths will cause problems. You also should have nothing else hooked up to PGC & PGD (RB6&7)

Do you have anything loading PGC & PGD?
no , nothing
i shortened the cable to about three inches
 
Code:
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to MPLAB ICD 2
Target Device PIC16F877A found, revision = b4
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready

Downloading Operating System
ICD0152: Failed to read all of requested bytes (0x0 of 0x8)
...Download Operating System Failed
ICD0152: Failed to read all of requested bytes (0x0 of 0x2)
ICD0082: Failed MPLAB ICD 2 operation
ICD0082: Failed MPLAB ICD 2 operation
ICD0082: Failed MPLAB ICD 2 operation
ICD0082: Failed MPLAB ICD 2 operation
MPLAB ICD 2 Ready
question ? i have had the option to automatically download the os selected all along..but when i manually try to D/L it i get the above error.
i'm thinking the os goes into the target?
all transistors are the right way round.
i have scoped RC3, RC4 , & RC5 ,on the inchworm 16F877 and nothing is comming from them, maybe it never gets to that point , i just dont know.
 
blueroomelectronics said:
It almost sounds like the wrong bootloader firmware. Is it a 16F877A or 16F877-20. They both use different bootloaders.
it is a 16F877 - 20 , on the inchworm kit.
and a 16F877A as the target.
 
blueroomelectronics said:
It almost sounds like the wrong bootloader firmware. Is it a 16F877A or 16F877-20. They both use different bootloaders.
it is a 16F877 - 20 , on the inchworm kit.
and a 16F877A as the target.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top