Hi battlecoder, thanks for sharing your work.
I 'm trying to understand your code and how e.g. from the 'PIC16F627A/628A/648A EEPROM Memory Programming Specification' you created the code you created.
(because I want to be able to do the same for any MCU or EEPROM and specifically for an EEPROM I have(EN25F80))
I read in the above mentioned document, page 11:
To perform a Bulk Erase of the program memory, the following sequence must be performed:
1.Execute a Load Data for Program Memory with the data word set to all ‘1’s (0x3FFF).
2.Execute a Bulk Erase Program Memory command
3.Wait TERA for the erase cycle to complete.
From this you created this code:
ReturnCode execute_serial_cmd() {
switch (cmdCode) {
// PGM Memory Erase --------
.................
case ZEPPP_CMD_PGM_MEM_ERASE:
load_pgm_mem (0x3fff);
bulk_erase_pgm_mem();
Am I correct?
Yep. Tried to follow the programming specifications as much as possible, but when i found differences between devices I normally checked if one of the methods also worked on the other devices first, before having device-specific implementations of a particular process.
A set of wires connected to a PC parallel port will do LVSP just as well.
In fact the first programmer I built for myself used the parallel port! It required several components, but they were mostly for the HVP part. LVP can totally be done with nothing but the LPT port. It's unfortunate that it's not a popular port nowadays and computers no longer have it.
So let 's say I have a 16F628A.
Using the 'PIC16F627A/628A/648A EEPROM Memory Programming Specification' I will try to make the algorithm for entering LVP mode (Low Voltage Program).
The 4 pins that should be used are PGM(RB4), MCLR(RA5), DATA(PGD (RB7)) and CLOCK(PGC (RB6))?
Page 6: ' Low voltage Program/Verify mode is entered by raising VDD, then MCLR and PGM, as shown in Figure 2-3'
Enter Low voltage Program/Verify mode:
1. supply PIC with power
2. PGM must be set to HIGH
3. MCLR must be set to HIGH
Is my pseudocode correct?
How much time should pass between these commands? Where can I find this?
As NorthGuy already mentioned, all the information is in the programming specs.
If you are able to generate the signals with the appropriate timing, yeah, you don't need An arduino. You could use a Raspberry Pi, a PC with a Parallel port, a Wemos board, whatever allows you to create logic-level signals according to the specs.
My project uses an Arduino to create the signals because they are simple, cheap, and can be connected to a computer via USB, which is a port you will find in any computer built after the Stone Age.