gnupic: erase flash device with PICP
Subject:
Re: erase flash device with PICP
From:
Declan Moriarty ####@####.####
Date:
25 Nov 2002 17:18:01 -0000
Message-Id: <02112517170800.00361@genius.chateau.dec>
On Monday 25 November 2002 14:15, you wrote:
> Em Seg, 2002-11-25 às 07:35, Declan Moriarty escreveu:
> > picp |more
> >
> > That gives you all the instructions. The erase code is
> > picp <comport> <device> -ep
> >
> > All instrructions are the same format except for the switch at the end.
> > It bartfs on an erase of a 16f877 for me with my firmware (check yours
> > with the -v option) but actually performs it.
>
> It doesn't work:
>
> [antonio@axc antonio]$ picp /dev/ttyS1 16f877 -rc
> configuration bits: 0x0400
> [antonio@axc antonio]$ picp /dev/ttyS1 16f877 -ep
> program memory: not blank
> failed to erase program space
> [antonio@axc antonio]$
It doesn't think it does, but it seems to have done so for me. Try this test:
picp -ep /dev/ttyS1 16f877 -ep (stick in your appropiate switches here)
Go away and start reading the Bible. When you're halfway through (!), it will
throw up an error and kick out. Then try
picp /dev/ttyS1 16f877 -rp down.hex
gpdasm down.hex |less
You will see it is all 0xff . picp craps out and says it has failed, but it
seems to have worked
To address the config bits, use 'c' instead of 'p' in the switches. I put
__CONFIG directives in the assembler, and then the config bits are set when
you program. It's also handy because gpsim uses them, and turning off the wdt
is impossible without them. The __config directives are undocumented in linux
to date - refer to mplab docs. They all work, mind you, but extremely fussy
on syntax.
The 'p' in the option is program space. I have __CONFIG directives in my
code, so programming the code space also programs the config bits.
--
Regards,
Declan Moriarty