Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Attiny13 RFID reader to send the code via RS232

Status
Not open for further replies.

Vermes

Advanced Member level 4
Joined
Aug 2, 2011
Messages
1,163
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,316
Activity points
22,318


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
 

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
 

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.
 

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
 

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".
 



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
:cry: :cry: :cry:
i dont know what should i do?? help plz
may u give me ur code??
:???: :sad: :roll:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top