Saving RFID Data


Closed Thread
Results 1 to 27 of 27
  1. #1

    Default Saving RFID Data

    Hi,

    I search the Best way to save RFID Data !

    Did some one have experience what I should use EEprom or something else.

    I Try with 24C08 but the problem is that I have a adress byte but how this can work when I go for example to adress 512 this is more then a byte.

    Adress var byte
    Adress = 512 but this is not byte anymore

    I2CWrite sda,scl,%10101000,Adress,[$00,$16,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$00,$00]

    Thanks for any example.

    Regards Pesti
    Last edited by Pesticida; - 29th January 2008 at 16:51.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Hi,
    I search the Best way to save RFID Data !
    Did some one have experience what I should use EEprom or something else.
    I Try with 24C08 but the problem is that I have a adress byte but how this can work when I go for example to adress 512 this is more then a byte.
    Adress var byte
    Adress = 512 but this is not byte anymore
    I2CWrite sda,scl,%10101000,Adress,[$00,$16,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$00,$00]
    Thanks for any example.
    Regards Pesti
    Then I suppose your address might magically become a WORD just like the good book says in the I2CWrite section...and I quote:

    The Address size sent (byte or word) is determined by the size of the variable that is used. If a byte-sized variable is used for the Address, an 8-bit address is sent. If a word-sized variable is used, a 16-bit address is sent. Be sure to use the proper sized variable for the device you wish to communicate with. Constants should not be used for the Address as the size can vary dependent on the size of the constant. Also, expressions should not be used as they can cause an improper Address size to be sent.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Thank you !
    I understand what you mean but on the PDF File for the 24C08 they says that the adress is just a byte and not a word.

    Now my question is how can I write for example on adress 512 or 700 when I can just use a byte adress and not a word.

    For the 24c02 and 24c01 I dont have Problems but when I need more then 256 bytes I can not read or write.
    Can I use this I2CWrite sda,scl,$A9,here >512<here,[Tmp_Data]

    Thanks

    Regards Pesti

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Ok!

    I found that the 24C08 have 2 Blocks but thats mean that each block have 512 Bytes!
    how can I read or write the first block or the second!?

    I have just a byte adress!

    regards Pesti

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Ok!
    I found that the 24C08 have 2 Blocks but thats mean that each block have 512 Bytes!
    how can I read or write the first block or the second!?
    I have just a byte adress!
    regards Pesti
    Now the answer you want is in the I2CREAD section instead of the I2CWRITE, which, incidentally, goes hand in hand with I2CREAD, because to I2CREAD something, first you have to I2CWRITE something, unless you would rather I2CREAD an empty chip, which isn't really empty, but full of no data, and sometimes no data is better than some data, either of which can be I2CREAD quite effectively, and either of which can be I2CWRITTEN over to replace either the no data or the some data which will be I2CREAD later on.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Thats mean i must use something like this:

    EraseEEprom= $A8
    EEprom_Block = 0
    Tmp_Daten = $00

    EraseEEprom:
    Erase_Loop:
    for NextAdr = 0 to 255
    I2CWrite sda,scl,EEprom_Adresse,NextAdr,[Tmp_Daten]
    pause 10
    Sound Buzzer,[122,1]
    next NextAdr
    EEprom_Adresse = EEprom_Adresse + 2
    EEprom_Block = EEprom_Block + 1
    if EEprom_Block => 4 then EEprom_Block = 0 : goto Exit_Loop2
    goto Erase_Loop
    Exit_Loop2:
    Sound Buzzer,[122,250]
    goto Main


    Regards pesti

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Make it easy on yourself, get a 24C256, 32k x 8 eeprom. Word address, byte data

    I2Cwrite datapin, clockpin, $a0, address, data

    But if you're hellbent on using the 24c08...

    address var word 'only use lower 10 bit
    addr var byte
    control var byte

    addr = address.lowbyte
    control = $a0 + ( address.highbyte << 2 )
    i2cwrite datapin, clockpin, control, address, data-whatever

  8. #8


    Did you find this post helpful? Yes | No

    Default

    OK,

    I must write this :
    Control = $A1
    For address = 0 to 1023
    addr = address.lowbyte
    control = $a0 + ( address.highbyte << 2 )
    I2CRead sda, scl,Control, addr,[EEprom_Daten[Byte_Count]]
    Pause 10
    Byte_Count = Byte_Count + 1
    if Byte_Count > 15 then
    Byte_Count = 0
    HSEROUT [DEC3 NextAdr-15, ": ",HEX2 EEprom_Daten[0],HEX2 EEprom_Daten[1],HEX2 EEprom_Daten[2],HEX2 EEprom_Daten[3],HEX2 EEprom_Daten[4],HEX2 EEprom_Daten[5],HEX2 EEprom_Daten[6],HEX2 EEprom_Daten[7],DEC2 EEprom_Daten[8],DEC2 EEprom_Daten[9],DEC2 EEprom_Daten[10],DEC2 EEprom_Daten[11],DEC2 EEprom_Daten[12],DEC2 EEprom_Daten[13],HEX2 EEprom_Daten[14],HEX2 EEprom_Daten[15],13,10]
    endif
    next address

    Or I make again a mistake ?!

    Regards Pesti
    Last edited by Pesticida; - 29th January 2008 at 20:59.

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Or I make again a mistake ?!

    Regards Pesti
    I don't know. Does it work?
    If it does, then you didn't make a mistake.
    If it doesn't, then there must be a flaw in your logic.

  10. #10


    Did you find this post helpful? Yes | No

    Default

    Hi

    No this dont work!

    My chip have the Pin E2 to VCC thats mean The Device Adress is :10101000 for Write and
    10101001 For Reading.

    I try all combination but dont work.

    Regards Pesti

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Hi

    No this dont work!

    My chip have the Pin E2 to VCC thats mean The Device Adress is :10101000 for Write and
    10101001 For Reading.

    I try all combination but dont work.

    Regards Pesti
    Ok, is it the serial part that's not working?
    The EEPROM is returning bad data?
    Is the program running?
    Which is it?
    Think simple...build it up...
    Make the LED blink...Show some data on the LED...Make the HSEROUT work
    I know you don't have an LED here...maybe you should put one there eh?

  12. #12


    Did you find this post helpful? Yes | No

    Default

    Hi,

    im so Stupid I forgott something important ,on the Chip I forgott to set WC Low,and i use now more pause to write and to read data.
    Now is working but what i don't understand ,on the 24C02 i dont set wc too and has working!

    What you think is this a good Idea to use 24c chips to store rfid tags data,the chips have a 1000.000 write cyclus.

    When I write on one day Double (Write and Erase) I have then on one Day maybe 4 Write Cycle.

    Thank You

    Regards Pesti

  13. #13
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    depending the warranty and service you want to provide... but you could use F-RAM instead

    Quote Originally Posted by FM24C04A datasheet
    Endurance
    Internally, a FRAM operates with a read and restore
    mechanism. Therefore, endurance cycles are applied
    for each read or write cycle. The FRAM architecture
    is based on an array of rows and columns. Rows are
    defined by A8-A2. Each access causes an endurance
    cycle for a row. Endurance is virtually unlimited. At
    3000 accesses per second to the same segment, it will
    take more than 10 years to reach the endurance limit.
    not bad
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  14. #14


    Did you find this post helpful? Yes | No

    Default

    Thank You Mister_e

    The RFID Data will be stored on the 24C and then Send trough GPRS Transmitter to Central Unit.

    If all is ok the data will be Erased.

    And I have again free space for new data.

    Regards Pesti

  15. #15


    Did you find this post helpful? Yes | No

    Default

    Ok

    All work fine now but :-)

    I receive the data from rfid reader in ascii i use to receive data on the pic this:

    Serin2 PortD.0,84,[Wait("E0") ,Daten[6],Daten[5],Daten[4],Daten[3],Daten[2],Daten[1],Daten[0]]

    Daten[7] = $E0

    but when I send to pc and to LCD with this

    HSEROUT [hex2 Daten[7],hex2 Daten[6],hex2 Daten[5],hex2 Daten[4],hex2 Daten[3],hex2 Daten[2],hex2 Daten[1],hex2 Daten[0],13,10]

    Lcdout $fe,$80,hex2 Daten[7],hex2 Daten[6],hex2 Daten[5],hex2 Daten[4],hex2 Daten[3],hex2 Daten[2],hex2 Daten[1],hex2 Daten[0]

    I receive on the PC and on the LCD this : E030343031303030

    I don't have found the way to convert to hex I need Hex on PC and on LCD.

    Thanks

    Regards Pesti

  16. #16
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    All work fine now but :-)
    I receive the data from rfid reader in ascii i use to receive data on the pic this:
    Serin2 PortD.0,84,[Wait("E0") ,Daten[6],Daten[5],Daten[4],Daten[3],Daten[2],Daten[1],Daten[0]]
    Daten[7] = $E0
    but when I send to pc and to LCD with this
    HSEROUT [hex2 Daten[7],hex2 Daten[6],hex2 Daten[5],hex2 Daten[4],hex2 Daten[3],hex2 Daten[2],hex2 Daten[1],hex2 Daten[0],13,10]
    Lcdout $fe,$80,hex2 Daten[7],hex2 Daten[6],hex2 Daten[5],hex2 Daten[4],hex2 Daten[3],hex2 Daten[2],hex2 Daten[1],hex2 Daten[0]
    I receive on the PC and on the LCD this : E030343031303030
    I don't have found the way to convert to hex I need Hex on PC and on LCD.
    Thanks
    Regards Pesti
    Have you opened your PicBasicPro manual since you bought PicBasicPro?
    What do you think the HEX2 does FOR you?
    Take the HEX2 out of your HSEROUT and you'll get raw data.
    Last edited by skimask; - 31st January 2008 at 20:15.

  17. #17


    Did you find this post helpful? Yes | No

    Default

    Hi

    Yes I read the book and i now that hex is to convert decimal in hex !
    I think i have a serial problem i have read more rfid chips and i receive always the same serial.

    Thank you

    Regards Pesti

  18. #18


    Did you find this post helpful? Yes | No

    Default

    Hi

    Yes I now what is happen the rfid send ascii,the pic receive the ascii and convert all the characters in decimal values 0 is 30 ,4 is 34 and so on.
    Than I have more than 8 bytes I have 16 bytes.
    I must now convert the decimals in hex,while i need hex data.

    I try with hex but dont work!

    Regards Pesti

  19. #19
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Hi
    Yes I now what is happen the rfid send ascii,the pic receive the ascii and convert all the characters in decimal values 0 is 30 ,4 is 34 and so on.
    Than I have more than 8 bytes I have 16 bytes.
    I must now convert the decimals in hex,while i need hex data.
    I try with hex but dont work!
    Regards Pesti
    Re-Read Post #16...then refer to your PBP on the proper use of SERIN/SEROUT/(etc) available modifiers and you WILL have your answer. I understand what you want, but I'm not going to give you the answer you need because you have all of the resources you need to get that answer...and you might learn something.

  20. #20


    Did you find this post helpful? Yes | No

    Default

    Sorry Skimask!

    When I have 30 34 30 31 thats mean i need a modifier with 4 to have 04 and 01.

    Regards Pesti

  21. #21
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Sorry Skimask!
    When I have 30 34 30 31 thats mean i need a modifier with 4 to have 04 and 01.
    Regards Pesti
    Yes, I know...and your answer awaits...

  22. #22


    Did you find this post helpful? Yes | No

    Default

    Hi,:-)

    I Use this:

    DEBUGIN [WAIT("E0"),dec4 Daten[14], dec4 Daten[13], dec4 Daten[12], dec4 Daten[11], dec4 Daten[10], dec4 Daten[9], dec4 Daten[8],dec4 Daten[7], dec4 Daten[6], dec4 Daten[5], dec4 Daten[4], dec4 Daten[3], dec4 Daten[2], dec4 Daten[1],dec4 Daten[0]]

    While DEBUGIN more fast is,but i have now more bytes this is not what I want.

    And that with Raw data what you have mean is working: :-)

    HSEROUT ["E0",Daten[14], Daten[13],Daten[12], Daten[11], Daten[10], Daten[9], Daten[8], Daten[7], Daten[6], Daten[5], Daten[4], Daten[3], Daten[2], Daten[1],Daten[0],13,10]

    What is if I use instead dec4 hex modifier,can I reduce my bytes!?

    Thank you Skimask

    Regards Pesti

  23. #23


    Did you find this post helpful? Yes | No

    Default

    This is the Solution :-)

    DEBUGIN [WAIT("E0"),Daten[13],Daten[12],Daten[11], Daten[10], Daten[9],Daten[8], Daten[7],Daten[6], Daten[5], Daten[4], Daten[3], Daten[2], Daten[1], Daten[0]]
    Pause 50
    for N = 13 to 1 step - 2
    Daten[N]= ((Daten[N]-$30) *10) + (Daten[N-1]-$30)
    Pause 5
    next N
    High Led_Tag
    Gosub ReadTime
    Gosub Read_BCD

    HSEROUT ["E0",hex2 Daten[13],hex2 Daten[11],hex2 Daten[9],hex2 Daten[7],hex2 Daten[5],hex2 Daten[3],hex2 Daten[1],13,10]

    Regards Pesti

  24. #24
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    That wasn't quite the solution I was going for, but what you've got will work just fine.

    One thiing to note...in the first line below:
    Quote Originally Posted by Pesticida View Post
    Daten[N]= ((Daten[N]-$30) *10) + (Daten[N-1]-$30)
    You might want to put in some code for checking an out-of-bounds condition.

  25. #25


    Did you find this post helpful? Yes | No

    Default

    Hi Skimask,

    What you mean with out of bond!?

    Did you mean when I receive a wrong character.

    Regards Pesti

  26. #26
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    Hi Skimask,
    What you mean with out of bond!?
    Did you mean when I receive a wrong character.
    Regards Pesti
    What happens if you get a character that you weren't expecting? One with a value too low or too high...

    For instance:
    Daten[N]= ((Daten[N]-$30) *10) + (Daten[N-1]-$30)

    What happens if the value in 'Daten[N]' or 'Daten[N-1] is $30? is $20? is $0?

  27. #27


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Ok this is a very good argument ! :-)

    Is good that you have warnning me I forgot this :-(

    I think that i should the Data discard !

    Or I think wrong !?

    Something like this:

    Bad_Data var bit
    Bad_Data = 0

    Data_Check:
    for N = 0 to 13
    If Daten(N) < $30 then Bad_Data = 1 : Daten(N) = $30
    Next N
    Select case Bad_Data
    case 0 ' it's all ok
    for N = 13 to 1 step - 2
    Daten[N]= ((Daten[N]-$30) *10) + (Daten[N-1]-$30)
    Pause 5
    next N
    case 1 ' no good :-)
    Bad_Data = 0
    Goto Warning or something like that
    end select

    If I have Daten[N] = $30 this is not bad while $30-$30 = 0

    Regards Pesti
    Last edited by Pesticida; - 2nd February 2008 at 06:42.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts