HVSP and EEPROM

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.

I'm working on a project that uses the 6 I/O pins inthe ATtini85.

The problem is that sometimes I need to write some EEPROM values externally with an HVSP.

I'm trying to do it using a Raspberry, but I can't write to the EEPROM.

I can read and write fuses, lockbits, and I can read the EEPROM. But when I try to write to the EEPROM it only stores garbage.

I've followed all the steps printed in the datasheet, but it doesn't work.

Does anyone know if there is anything that isn't in the datasheet and is needed for writing to the EEPROM in HVSP mode?

Thanks

This topic has a solution.
Last Edited: Tue. Dec 4, 2018 - 06:12 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you say it is writing "garbage" it's hard to know exactly,

but one possibility is that all of the existing zero bits remain

when you are programming a new value.  With EEPROM, there

are two steps to writing a new value.  First there is an erase

step which brings all of the bits to '1' and then you write the

value you intend which pulls any zero bits down.

 

A note in the HV programming section says:

Note that auto-erase of EEPROM is not available in High-voltage Serial Programming, only in SPI Programming.

So if you haven't done a Chip Erase, including erasing the EEPROM

prior to programming it, then this could explain the problem you

are noticing.

 

--Mike

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avr-mike wrote:
So if you haven't done a Chip Erase, including erasing the EEPROM prior to programming it, then this could explain the problem you are noticing.
Note that with HVSP it is not possible to erase only a byte of EEPROM, nor a page of EEPROM, nor even all of EEPROM.  The only way to erase EEPROM is via a chip erase command, which will erase EEPROM, lock bits, and flash.

 

You could unprogram RSTDISBL over HVSP, then use ISP to erase/program EEPROM, then again program RSTDISBL.

 

What is this project which uses all 6 I/O pins?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Tue. Dec 4, 2018 - 04:04 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are right. I've ignored the note about EEPROM erase.

 

I need the 6 pins because I'm using a SIM800 and a HC-12 for communicating with a zone without GSM network, and these take the 6 pins for the UART and the SET/RESET pins. The GPRS and server parameters are stored in the EEPROM.

 

Probably the best solution is unprogram the RSTDISBL and write the EEPROM with ISP, as joeymorin said.

 

Thanks to all.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pacoandres wrote:
Probably the best solution is

Or use an AVR with more I/O pins!

 

Jim

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
Or use an AVR with more I/O pins!

That's what I was thinking.  There are many of the new models that have a real USART as well as a few more pins.  (dare I say less expensive than a Tiny85?)

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.