Skip to content

Commit

Permalink
Fix issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
wagiminator committed Mar 1, 2024
1 parent 3228ccc commit 7a8c9eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Binary file modified picoISP_Programmer/software/picostk/picostk.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion picoISP_Programmer/software/picostk/picostk.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ===================================================================================
// Project: picoSTK AVR ISP Programmer based on CH551, CH552, CH554
// Version: v1.2
// Version: v1.3
// Year: 2023
// Author: Stefan Wagner
// Github: https://github.com/wagiminator
Expand Down
15 changes: 9 additions & 6 deletions picoISP_Programmer/software/picostk/src/isp.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,11 @@ uint8_t write_flash(uint16_t length) {
}

uint8_t write_eeprom(uint16_t length) {
uint16_t x;
for(x = 0; x < length; x++) {
spi_transaction(0xC0, 0x00, (_addr << 1) + x, buff[x]);
uint16_t x = 0;
_addr <<= 1;
while(x < length) {
spi_transaction(0xC0, _addr >> 8, _addr, buff[x++]);
_addr++;
DLY_us(9600);
}
return STK_OK;
Expand Down Expand Up @@ -310,9 +312,10 @@ uint8_t flash_read_page(uint16_t length) {
}

uint8_t eeprom_read_page(uint16_t length) {
uint16_t x;
for(x = 0; x < length; x++) {
CDC_write(spi_transaction(0xA0, 0x00, (_addr << 1) + x, 0xFF));
_addr <<= 1;
while(length--) {
CDC_write(spi_transaction(0xA0, _addr >> 8, _addr, 0xFF));
_addr++;
}
return STK_OK;
}
Expand Down

0 comments on commit 7a8c9eb

Please sign in to comment.