+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Advanced Member level 4
    Points: 6,017, Level: 18

    Join Date
    Aug 2011
    Posts
    1,163
    Helped
    0 / 0
    Points
    6,017
    Level
    18

    Attiny13 RFID reader to send the code via RS232



    It is a design of a system which reads the card code via interface EM4095 with an antenna, decodes, checks and sends it through the serial port. The reader is based on Attiny13. Program takes only 782 bytes.

    Electronics:
    The whole was made by threaded method. Ready made interface EM4095 was used in this project because it has a perfectly chosen antenna and it is cheaper to buy a ready module. Interface is a typical circuit EM4095. Pins of analog system (MOD, DEMOD_OUT, SHD, RDY_CLK) are derived to the header strip. The system can be easily home made. The board was made by thermal transfer method, drilled by a 0,8mm drill, then painted with clear nails lacquer. The reader can be placed in the headers on the interface using FHY06 SSG PIN HEADER connector. Of course, you can use a simple header strip instead of a socket and connect other interfaces EM4095 or put everything as a part of a larger project.

    Firmware – microcontroller software:
    Before programming the microcontroller, the fusebits should be set properly. By default, Attiny13 has dividing by 8 enabled. This option must be disabled. If the clock is set to a different frequency than 9,6MHz, set that value. Fusebits are as follows: High fuse: FF Low fuse: 7A. If you have other values, the program can not work properly.

    It is important to connect the system to interface EM4095 before you enable the supply. Program after connecting the supply initializes system EM4095 and goes into its normal mode (waiting for the card). In the case of connecting the system to the interface with enabled supply, the microcontroller will not make the necessary initialization of system EM4095 and can not receive data.

    You can upload the software in two version to the reader. They have different speed of data sending via serial port. Other parameters such as the transmission protocol, terminals, etc. remain unchanged. Available speed of data transfer:
    • 9600 bps
    • 4800 bps


    Theoretically at a speed 9600 bps and internal oscillator 9,6MHz (fluctuations 9,45-9,7MHz) transmission errors can occur (approximately 0,8%) while they should not occur at 4800 bps.

    Data frame:
    The reader sends 14 bytes of data.

    • 1. 0x0a LF
    • 2. 0x0d CR
    • 3. 0x7E start of transmission of the card code
    • 4.-13. hex code of the card. Each byte contains one hexadecimal digit
    • 14. 0x7Cend of transmission


    Serial transmission settings:

    Speed: depending on the chosen program: 9600 or 4800
    • Data bits: 8
    • Stop bits: 1
    • Parity: None


    For continuous holding a card in the field of antenna, the code is cyclical sent every 0,7s.

    Program was written in C (AvrStudio 4 + WinAVR-20100110) and in Assembler.

    Data receiving on PC or other microcontroller:
    A program receiving data from a serial port should be installed on a computer. It can be a terminal (Putty or Br@y++) or you can use your own code (as a fragment of an application).

    Pictures:



    Link to original thread (useful attachment) – [C] Attiny13A czytnik RFID wysyłanie kodu przez RS232

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 20,441, Level: 34
    Achievements:
    7 years registered
    pranam77's Avatar
    Join Date
    Apr 2008
    Location
    INDIA
    Posts
    2,780
    Helped
    626 / 626
    Points
    20,441
    Level
    34

    Re: Attiny13 RFID reader to send the code via RS232

    Thanks for sharing. Infact i translated the original page but coudnt get a clear idea about the same. May be the translation is not accurate or i am assuming this project to be something else whichg it is not.
    As i understood, it is a 125Khz RFID tag reader whcih will output the data in RS232 format whcih can be read with the PC on hyperterminal or the given software. But to read it requires an antenna which is not described or mentioned anywhere in the article or the schematics or in any of the downloaded files. Can some one guide me in this regard?
    Pranam

    •   AltAdvertisement

        
       

  3. #3
    Super Moderator
    Points: 81,434, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,349
    Helped
    4456 / 4456
    Points
    81,434
    Level
    69

    Re: Attiny13 RFID reader to send the code via RS232

    I'm guessing the board is a protocol converter and nothing more. The antenna is on the actual RFID module, the ring of tracks around the larger green PCB. I have something similar here using InfoSys RFID modules, the antenna is fabricated on the back of the PCB.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.

    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 5
    Points: 20,441, Level: 34
    Achievements:
    7 years registered
    pranam77's Avatar
    Join Date
    Apr 2008
    Location
    INDIA
    Posts
    2,780
    Helped
    626 / 626
    Points
    20,441
    Level
    34

    Re: Attiny13 RFID reader to send the code via RS232

    Yes..Brian..thanks for the info. Infact i didnt note the tracks on the Green PCB. If the Tiny13 is used to convert the levels, it will naturally cost more or less the same compared to a MAX232 IC.
    Pranam

  5. #5
    Advanced Member level 2
    Points: 5,180, Level: 17
    Achievements:
    7 years registered
    ZASto's Avatar
    Join Date
    Jan 2008
    Location
    Messy Corner, 44°47'31.56"N, 20°28'9.16"E
    Posts
    618
    Helped
    126 / 126
    Points
    5,180
    Level
    17

    Re: Attiny13 RFID reader to send the code via RS232

    Hi pranam77,
    it seems that tiny is decoding the bitstream from the chip that is located on the big green and the sending the data to the PC through quick'n'dirty "level converor" made by 2 resistors.
    Check the MikroE site for their RFID "reader".
    Make no mistake between my personality and my attitude.
    My personality is who I am.
    My attitude depends on who you are.

    •   AltAdvertisement

        
       

  6. #6
    Newbie level 1
    Points: 13, Level: 1

    Join Date
    May 2013
    Posts
    1
    Helped
    0 / 0
    Points
    13
    Level
    1

    Re: Attiny13 RFID reader to send the code via RS232

    Quote Originally Posted by Vermes View Post


    It is a design of a system which reads the card code via interface EM4095 with an antenna, decodes, checks and sends it through the serial port. The reader is based on Attiny13. Program takes only 782 bytes.

    Electronics:
    The whole was made by threaded method. Ready made interface EM4095 was used in this project because it has a perfectly chosen antenna and it is cheaper to buy a ready module. Interface is a typical circuit EM4095. Pins of analog system (MOD, DEMOD_OUT, SHD, RDY_CLK) are derived to the header strip. The system can be easily home made. The board was made by thermal transfer method, drilled by a 0,8mm drill, then painted with clear nails lacquer. The reader can be placed in the headers on the interface using FHY06 SSG PIN HEADER connector. Of course, you can use a simple header strip instead of a socket and connect other interfaces EM4095 or put everything as a part of a larger project.

    Firmware – microcontroller software:
    Before programming the microcontroller, the fusebits should be set properly. By default, Attiny13 has dividing by 8 enabled. This option must be disabled. If the clock is set to a different frequency than 9,6MHz, set that value. Fusebits are as follows: High fuse: FF Low fuse: 7A. If you have other values, the program can not work properly.

    It is important to connect the system to interface EM4095 before you enable the supply. Program after connecting the supply initializes system EM4095 and goes into its normal mode (waiting for the card). In the case of connecting the system to the interface with enabled supply, the microcontroller will not make the necessary initialization of system EM4095 and can not receive data.

    You can upload the software in two version to the reader. They have different speed of data sending via serial port. Other parameters such as the transmission protocol, terminals, etc. remain unchanged. Available speed of data transfer:
    • 9600 bps
    • 4800 bps


    Theoretically at a speed 9600 bps and internal oscillator 9,6MHz (fluctuations 9,45-9,7MHz) transmission errors can occur (approximately 0,8%) while they should not occur at 4800 bps.

    Data frame:
    The reader sends 14 bytes of data.

    • 1. 0x0a LF
    • 2. 0x0d CR
    • 3. 0x7E start of transmission of the card code
    • 4.-13. hex code of the card. Each byte contains one hexadecimal digit
    • 14. 0x7Cend of transmission


    Serial transmission settings:

    Speed: depending on the chosen program: 9600 or 4800
    • Data bits: 8
    • Stop bits: 1
    • Parity: None


    For continuous holding a card in the field of antenna, the code is cyclical sent every 0,7s.

    Program was written in C (AvrStudio 4 + WinAVR-20100110) and in Assembler.

    Data receiving on PC or other microcontroller:
    A program receiving data from a serial port should be installed on a computer. It can be a terminal (Putty or Br@y++) or you can use your own code (as a fragment of an application).

    Pictures:



    Link to original thread (useful attachment) – [C] Attiny13A czytnik RFID wysyłanie kodu przez RS232
    hi
    i really need ur help
    i tried to make a project like yours
    but i couldnt
    the problem is my bascom codes
    i did it in perfect project with atmega8
    but with attiny13 i saw these errors
    this is my code:
    $regfile = "attiny13.dat"
    $baud = 4800
    $crystal = 7372800
    $hwstack = 24
    $swstack = 10
    $framesize = 24

    Config Portb.2 = Output
    Portb.2 = 0
    'Make SHD and MOD low
    Config Portb.3 = Output
    Portb.4 = 0

    Shd Alias Portb.4
    Config Shd = Output
    Shd = 0

    Dim Tags(5) As Byte 'make sure the array is at least 5 bytes
    'Dim J As Byte
    Dim A As Byte



    Open "comb.0:4800,8,n,1" For Output As #1

    Config Hitag = 64 , Type = Em4095 , Demod = Pinb.1 , Int = @int0


    Print #1 , "Test EM4095"



    On Int0 Checkints Nosave 'we use the INT1 pin all regs are saved in the lib
    Config Int0 = Change 'we have to config so that on each pin change the routine will be called
    Enable Interrupts




    Do
    'Print "Check..." 'my test
    If Readhitag(tags(1)) = 1 Then
    ' Print #1 , Chr(2) 'this will enable INT1
    For A = 5 To 1 Step -1
    'Print Hex(tags(j)) ; ",";

    A = Tags(j) / 16
    A = A + 48
    Print #1 , Chr(a)
    A = Tags(j) Mod 16
    A = A + 48
    Print #1 , Chr(a)


    Next
    ' Print #1 , Chr(0); 'CHECK SUM
    ' Print #1 , Chr(0); 'CHECK SUM
    ' Print #1 , Chr(13);
    ' Print #1 , Chr(10);
    ' Print #1 , Chr(3);

    ' Reset Portb.2
    Else
    'Set Portd.7
    End If
    Waitms 100

    Loop
    Close #1


    Checkints:
    Call _checkhitag
    Return

    an these are errors that belong to config hitag= 64 ... part:
    error : 222 line: 26 illegal character [expected (,got "[tifr0]] ,...
    error: 22 line : 26 out of sram space
    error: 22 line : 26 out of sram space
    error: 22 line : 26 out of sram space
    error: 22 line : 26 out of sram space
    error: 22 line : 26 out of sram space
    error: 22 line : 26 out of sram space
    error: 22 line : 26 out of sram space
    error: 22 line : 26 out of sram space

    i dont know what should i do?? help plz
    may u give me ur code??

--[[ ]]--