HC08 project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HC08 project

2,736 Views
mauricio2346
Contributor II
hi.  i need to create some kind of security device that open a door with a security code.   the basic algorithm is already done, but i have some troubles in one item: keep the value in the memory even without supply ( in other words, write on the flash memory)
the original idea is to write the code in  a vector, then that vector is compared with the vector with the corrct code.  if they are the same, the door opens.  easy.   to change the code is easy too, ( changing the vector ) but when you quit the uC supply,  the new data written in the  correct code dissapear!!! ( written in the uC ram).
anybody can help me??
thanks and sorry for mi english!!! :smileyhappy:
Labels (1)
0 Kudos
Reply
5 Replies

1,273 Views
bigmac
Specialist III
Hello,
 
Yes, you need to write your non-volatile data to a flash memory page set aside for that purpose.  This subject has been covered numerous times within this forum, and there are a number of application notes also.
 
It is not clear which HC08 device you are targeting.  Some of the smaller devices have built-in ROM routines that can simplify the process.
 
Regards,
Mac
 
0 Kudos
Reply

1,273 Views
mke_et
Contributor IV
I wouldn't write to a vector. I'd write the code to what might best be called an arena. An area of Flash that you can 'pre clear' when you write your program to the chip. You put your valid codes in there as a list. If you invalidate a code for any reason in the future, you over-write the value with 00's. If you want to add new valid codes, you just 'append' to the end of the list but still in the arena. To check for valid codes, you compare your check code, which will probably be in RAM, to each member of the list, but do NOT compare against all 00 or FF entries.

This should allow you to reprogram the device for valid codes with a keyboard sequence without having to reprogram the entire device. Hoperfully. Of course, if you run out of Flash in your arena, then you have to do a bulk erase, which depending on how much Flash you have and how it is laid out in the chip may or may not involve reprogramming the whole chip.
0 Kudos
Reply

1,273 Views
mauricio2346
Contributor II
Hi...
i'm a amateur and i need some help in that kind of things of programming.
the device i want to use is the MC68HC908JK3 (a little old but i have a lot of them in a box)
if the code lenght is about 4 numbers, what should be the program to keep this code in the flash memory??

i need some help...

Thanks!
0 Kudos
Reply

1,273 Views
PeterHouse
Contributor I
You will need to be abit more specific as to what "number" means.  I have worked on some garage door applications where each code was around 8 to 12 bytes and coded in an unusual number base.

For a simple combination lock type of application, I could see using anywhere from 2 to 8 bytes depending on security level and storage techniques.

Good Luck,

Peter House
0 Kudos
Reply

1,273 Views
mauricio2346
Contributor II
Hi.
yeah, i was thinking to create a couple of codes (four numbers, as a credit card password) to open the door.  one of them as a "general public password" . the other as a "private password".   i need to save that information (the password numbers) in the flash memory.  i need to keep that codes even without power supply (in the non-volatile memory).

first, i need to program the microcontroller (from PC, with CodeWarrior) to recognize any key of  the matrix keypad (4x4).   then,  during the execution of the program, save that  combination of numbers, in RAM (the  written password in the keypad).   the program had to compare the written password with the password saved in the flash memory.   if they match, the uC will open a door. 

i been reading the mc68hc908jk3/jl3 technical data book, and i have a few questions.  it says that the flash memory is done on a row basis (32 bytes, or 256 bits).  they start from $XX00, $XX20 and so.  in that rows, i can write any data (for example, the general public password), obviously, following the program sequence. 
How do i know what rows are empty to save the data?.   the uC saves the in-circuit program in a diferent memory zone, how it works?.

any example???  i need some help!!!
thanks a lot!
 


0 Kudos
Reply