Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

how to programm serial number?
Goto page Previous  1, 2
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Fri Feb 29, 2008 6:01 pm    Post subject: Reply with quote

Hi,

Why don't you put the serial number in the EEPROM?
Use the tool HEXinc to increment the serial number
in a EEPROM HEX file and then with stk500.exe program
first the flash memory and then the EEPROM. With the
Lock bits you can then protect Flash and EEPROM.

Best regards,

Luciano
Back to top
View user's profile
jenalcom

Bascom Member



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

australia.gif
PostPosted: Sat Mar 01, 2008 3:33 am    Post subject: Reply with quote

I store the serial number in EEPROM. I have a small PC programme which allows the user to read/change certain options in the software (including a users ID/serial number).

An extension of this programme allows me to set up the initial software options on my PC including a non-user changeable board serial number. The extended PC programme allows me to type in a new serial number or just hit a "NEXT" button to increment the serial number. I store the serial number as 1 alpha character plus 4 numbers in ASCII for readability but you can store it as you like.

The users version of the PC software allows them to change some options and shows them other stored parameters including the board serial number, software version number and compile date/time.

Alan
Back to top
View user's profile
Arera

Bascom Member



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

germany.gif
PostPosted: Sat Mar 01, 2008 11:22 am    Post subject: Reply with quote

@ Luciano:
Well, sounds quit good and professional, but I donīt want to learn all that STK500 / AVR Studio / HEXinc stuff for a simple serial-number.
For my IQ everything must follow the KISS directive (Keep It Simple, Stupid!).
But interessting anyway!

@ Alan:
Good idea, but not suitable for my little projekt: My device is a simple one-way RF transmitter, no way to to let the user interface with it.

Btw I must admitt a LITTLE leak of knowledge:
Embarassed I cannot program VB... Embarassed
My only interface PC - AVR is a simple terminal like Hyperterminal or Docklight (which is cool, check it out!)
(is it true, XP and VB cannot interface via COM-ports, unless you study informatic-scienses at university?)

I think, the PonyProg serialnumber and $LOADERSIZE willdo for me!
This thread has become a "manual for serialnumbers" thanks to all of you, Iīm shure it is usefull for a lot you freaks out there!
Back to top
View user's profile
jenalcom

Bascom Member



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

australia.gif
PostPosted: Sat Mar 01, 2008 12:04 pm    Post subject: Reply with quote

If you can't programme VB (neither can I) have a look at the excellent Liberty Basic for fairly simple programming of visual interfaces.

Alan
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Sat Mar 01, 2008 12:29 pm    Post subject: Reply with quote

Hi Arera,

In your first post you said:
I need to programm serial numbers into a large amount of chips.

If it is just for an hobby project, then use the code below where you
manually change the serial number and then recompile the program
for each chip.

Best regards,

Luciano

Code:
$regfile = "m128def.dat"
$crystal = 11059200
$baud = 9600

$hwstack = 32
$swstack = 16
$framesize = 40

Dim S As String * 20

Do

   Restore serial_number
   Read S
   Print S

   Waitms 1000

Loop

End

serial_number:
Data "serial1234567890"


Or

Code:
$regfile = "m128def.dat"
$crystal = 11059200
$baud = 9600

$hwstack = 32
$swstack = 16
$framesize = 40

Const SerialNumber = "serial1234567890"


Do

   Print SerialNumber

   Waitms 1000

Loop

End
Back to top
View user's profile
Arera

Bascom Member



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

germany.gif
PostPosted: Sat Mar 01, 2008 4:40 pm    Post subject: Reply with quote

Hi Luciano,
electronics is my profession, but im not an engeneer. Iīm educated to be, lets say, an engeneers helper. But in my company there is no engeneer Confused .
I do the developing, manufacturing, service, hotline, clean up the store, care about the light bulbs and the garbage order all needed stuff and a lot more.
That has disadvantages, but the advantages are stronger Very Happy

In my project I expect 50 to 500 units to be build each year.
Thatīs somewhere between hobby and beeing really professional.

Donīt you like the PonyProg way?
Seems easy and fast to me. If I have to build 50 units in a row, I plug the ISP in a unit, program it, and repaet that 50 times.

Whereīs the advantage in using the hexinc-way?
Or the disatvantage of the PonyProg-way?
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Sat Mar 01, 2008 5:51 pm    Post subject: Reply with quote

Hi,

With stk500.exe + HEXinc you can completely automate your system.

Set and verify the fuse bytes, increment your serial number in the
EEPROM HEX file, program and verify EEPROM and Flash, set and verify
the lock byte.

Before you set and verify the lock byte you can read the EEPROM and
make sure that the chip was programmed with the correct serial number.

In order to automate the system you will have to write a program that calls the
command line tools stk500.exe, HEXinc.exe and opens the text file stk500.log
which is used the get the responses from the ISP programmer. The same program
will keep track of the used serial numbers, so that when you start a new
programming session, the system will know which was the last used serial number.

* * *

From the PonyProg web site I see that some of the AVR chips are supported but
many of the supported chips were not tested.

Best regards,

Luciano
Back to top
View user's profile
jenalcom

Bascom Member



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

australia.gif
PostPosted: Sun Mar 02, 2008 5:43 am    Post subject: Reply with quote

PonyProg saved my day recently. I had a requirement to re-programme 250 boards in an African country where I couldn't visit and it was impracticable to return the boards to me.

I solved the problem by building a parallel port programmer (STK200 style) to connect the boards to and then wrote a batch file for PonyProg to programme the Flash and the Lockbits automatically. The result was that the user plugs in a board to reprogramme and then clicks on a desktop icon. This launches PonyProg, programmes the Flash and Lockbits then closes down. Very simple, effective and no programmes to purchase, learn, etc.

I was very impressed with how easy it all came together after searching for a few days for a solution. Certainly couldn't have done with with Bascom or AVR Studio considering the expertise of the user that had to do the reprogramming.

Alan
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Sun Mar 02, 2008 8:36 am    Post subject: Reply with quote

jenalcom wrote:
Certainly couldn't have done with with Bascom or AVR Studio considering the expertise of the user that had to do the reprogramming.


Hi Alan,

All what you need with AVR Studio is a batch file that calls the
command line tool stk500.exe and an AVRISP or AVRISP mkII programmer.
(AVRISP mkII = 36 USD).

Best regards,

Luciano
Back to top
View user's profile
jenalcom

Bascom Member



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

australia.gif
PostPosted: Sun Mar 02, 2008 10:51 am    Post subject: Reply with quote

Hi Luciano

I know that! But in this case the user was/is ignorant of programming techniques and I needed a very simple programming method that worked PLUS my boards have a 6 way edge connector (not a header) to programme them. Easier to just give them a box with a 6 way edge connector on top and a cable with a DB25 to plug into the parallel port. Worked first go apparently.

PonyProg is not the way I would normally programme boards and even AVR Studio I seldom use. Normally I just use Bascom and the STK200 clone - works for me and each to their own - the STK500 I bought is still sat in it's box virtually unused.

Alan
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
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