Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Adding date to EEPROM when programming device

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
sentinel

Bascom Member



Joined: 02 Feb 2009
Posts: 141
Location: Tasmania

australia.gif
PostPosted: Sat Jan 09, 2016 6:20 am    Post subject: Adding date to EEPROM when programming device Reply with quote

I hope this is not too off topic for this forum.
Does anyone know of a simple way to automatically add a date code to EEPROM when flashing the micro-controller?
This would have the dual benefit of uniquely identifying each chip while also informing when the flashing had been carried out.

Ideally, it would be in some format such as YYYYMMDDHHMMSS, which could then be retrieved by BASCOM AVR and reported if required.

I am able to write a Windows programme in Liberty Basic to retrieve the date & time from the PC clock and save as a .txt file, if that's any help.

I use an STK500 for programming.

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
entry2

Bascom Member



Joined: 29 Jul 2006
Posts: 54

germany.gif
PostPosted: Sat Jan 09, 2016 2:30 pm    Post subject: Reply with quote

Hello,

do you know the directive "$version" and command "version" from helpfile?

entry2.

_________________
Bascom: 2.0.8.5
Back to top
View user's profile Visit poster's website
sentinel

Bascom Member



Joined: 02 Feb 2009
Posts: 141
Location: Tasmania

australia.gif
PostPosted: Sat Jan 09, 2016 4:28 pm    Post subject: Reply with quote

Thanks, Entry2.
Version would work really well, except that the code would have to be re-compiled before every chip is flashed.
In a production run of 200 micro-controllers, that would be rather inefficient.
Back to top
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 548

PostPosted: Sat Jan 09, 2016 6:59 pm    Post subject: Reply with quote

Option 1.

- use RTC
- burn flash with uC bootloader that reads RTC and stores date/time in EEPROM.


Option 2.

-write your own uploading PC software to a uC bootloader that receives the date/time, stores it in EEPROM, then burns the flash.

Others??
Back to top
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1571
Location: Basel, Switzerland

switzerland.gif
PostPosted: Sat Jan 09, 2016 7:49 pm    Post subject: Reply with quote

Hi,

Option 3

a) Write a small PC app that reads the AVR Firmware file and pads it with afew extra Bytes at the end (date&time)
b) Use AVRDude to download a Firmware

Just write a simple Batch file that calls the first program, then the avrdude.

200 Chips aren't that much. I've programmed almost 1000 Chips in two days (using an olimex stand alone programmer).

Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1135

poland.gif
PostPosted: Sat Jan 09, 2016 9:36 pm    Post subject: Reply with quote

1. On Programmer Tab check "Upload Code and Data"
2. Create file that have the same name as main program but with EEP extension.
3. Build your own Windows Application that will update this file with actual date and time.

Thats it..


When I check "Upload Code and Data" then in programmer log I can read "EEP file not found"
This means that if file will be present then programmer automatically should upload also Data you need Wink
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6197
Location: Holland

blank.gif
PostPosted: Sat Jan 09, 2016 9:40 pm    Post subject: Reply with quote

you can also send a request to support. for a fee we can add such an option to the IDE.
_________________
Mark
Back to top
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2483
Location: Queensland

australia.gif
PostPosted: Sun Jan 10, 2016 11:51 pm    Post subject: Reply with quote

Another option is to program chips just with a bootloader at build. Then when you load the main program code ( and most likely the EEPROM ) insert the data/time/serial number into eprom at that point. I do that with some of our production stuff, in this case just unique serial number.

The advantage is that you can use any programmer to load the bootloader, and then load the working code from a propietary uploader which is only serial connected to the target, and can include any special functions you like.

Also means you can give distributors and customers versions of that loader to do their own upgrades.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
sentinel

Bascom Member



Joined: 02 Feb 2009
Posts: 141
Location: Tasmania

australia.gif
PostPosted: Tue Jan 12, 2016 3:59 am    Post subject: Reply with quote

Thanks to everyone for their very helpful answers. It looks like there are multiple ways to skin a cat.

Thanks Mark, for the offer. I'll keep it in mind while I try out a few of the options. This feature may well be a welcome addition to the IDE.

Looks like I have to do some reading, for example how to use AVR Dude and using bootloaders. The ability of customers to do firmware upgrades in the field would also be useful.
Back to top
View user's profile
Arera

Bascom Member



Joined: 23 Sep 2007
Posts: 386
Location: Wuppertal, Germany

germany.gif
PostPosted: Tue Jan 12, 2016 2:58 pm    Post subject: Reply with quote

Option 43:

Think of letting the Date/Time thing down. What meaning does it have, in case the item stays in the shelf for 7 month.
Rather use serial numbers. Note whatever information which is useful for you in an excel sheet or whatever, relatet to the serial number:

#13459: HW Version 3.8, SW version 65.003, assembled 27.12.2015 by Alex, flashed 31.12.15 by Mike, Quality checked 23.1.2016 by Hans, stored in shelf A23, delivered 25.07.2019 by order O45674....

That's the way I do it with success.
I use PONYPROG. It's simple, free, and handles serial numbers. All you need is the project.hex file.

PS:
Haven't used PonyProg for a while. Just found out it doesn't run on my new PC, it needs X86.... Rolling Eyes
Back to top
View user's profile
jenalcom

Bascom Member



Joined: 10 Apr 2004
Posts: 365
Location: Perth, Western Australia

australia.gif
PostPosted: Wed Jan 13, 2016 2:51 am    Post subject: Reply with quote

Ponyprog will do automatic incrementing of serial numbers but not date or time.

A couple of products I have made, which allow user configuration, I have used Liberty Basic to do the initial setup of configuration. Included in that is the ability to set serial number and time/date stamp of the initial config (which is done when the item is ready to ship to the customer).

I have two programmes. A factory programme and a field programme. The field programme allows the customer to do his config. The factory programme is identical to the field programme except that it also allows me to set things the customer cannot - that is serial number, software version and a couple of other things. This idea is not much use if you don't have a user configuration programme.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum