Re: Ruined U2 Programmer?
Yes, I think there's a problem with the programmer.
But I'm not referring to the U2. :)
Code:
CMCON0 = 7 ; disable comparator
And don't change individual outputs so fast. You will begin to see the Hardware R-M-W issue.
Either set them all at once, or put a small delay between changing separate pins.
Code:
OSCCON = %01110000 '8 MEG INTERNAL
DEFINE OSC 8 ' TELL EVERYBODY
TRISIO = 0 ' OUTPUT ONLY
ANSEL = 0 ' DIGITAL
CMCON0 = 7
MAIN:
GPIO = %00000111
Pause 500 ' Delay for .5 seconds
GPIO = %00000000
Pause 500 ' Delay for .5 seconds
Goto MAIN
BTW. If you turn on "Verify After Programming", and it verifies ... the U2 is working properly and the chip has been programmed successfully.
To insure all sections of the PIC are being programmed, go to Options > More Options > Set Options to Defaults.
Re: Ruined U2 Programmer?
Humor, advice, salvation - I think we have made a Hallmark moment perhaps?
I am at work and cannot try this yet, but was eager to thank you. I tried so many configurations on both the '88 and '683 that I cannot be positive that this is the whole solution. Surely you are right that "verify" shall be proof beyond doubt; I feel the fool for not having considered this myself.
In the case that I have not another opportunity in advance, I wish you all a happy Thanksgiving. All the best to you and yours throughout the holiday season.
Re: Ruined U2 Programmer?
Also, the U2 programmer has some sort of short circuit protection built in, and I know that by experience :). There was one time I was programming ICSP in a circuit that had a short in the power lines. Nothing happened to the U2 programmer, but the USB port got broken. Luckily, I was using a USB hub and that was the only thing that got fried.
Robert
Re: Ruined U2 Programmer?
Well, to close this thread I will relate my findings.
With Darrel's help and assurance from Robert that the programming device should still work, I began exploring my issue.
Even with the corrected software and code verifying, I had problems as before. No amount of frustration seemed adequate to resolve the issue. From my research it seems that none of the chips would sink current, unless another pin was in use - except, when it would (I know, but really... this is how it appeared to be). My 'scope - an old one, but freshly calibrated - showed only a 3V drop between pin HIGH and pin LOW (verified by the faint glow of LEDs alternately connected). Yes, except when it was a 5V drop and all worked as it should. It was very frustrating to be so inconsistent.
As an alternative to chewing off my thumb, I tried another new chip - number five. All the four previous with the same issue, a mix of 3 16F88 and 1 12F683, oddly working and driving (or not) LEDs on different pins.
Johnny was right - number 5 is alive; every issue is magically corrected.
For my farm I cannot understand how... Chips that have worked perfectly and were put away carefully, packed in non-conductive foam and in a non-conductive box (from my favorite cigars) were fails of exactly the issue of those I had exposed to damage. I tell you frankly, had any of you explained the issue I could not believe the truth of it, and yet...
Now I do not know whether to investigate my neighbors for some unauthorized death ray pointed haphazardly or to search in the basement for fear my wife has nuclear waste stored without my knowledge. Or perhaps it was some intermittent USB or programmer issue (the electronic one, not the burned curtain, missing one eyebrow from fire one) that will haunt me again in the future. At this point, one answer seems as likely as the others.
Re: Ruined U2 Programmer?
Before you close the thread...
Did you try turning off Capture/Compare/PWM?
CCP1CON = 0?
To the point of not pulling down to 0 volts on the pins, turn off global pull-ups:
OPTION_REG.7 = 1 (1 is disabled).
Re: Ruined U2 Programmer?
Don't close a thread. You never know if more posts will be useful. Admins only close threads that get out of hand.
Robert