1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Tem
28th

Pic ile Smart Kontrol Devresi

 

smart-card.jpg

Yaygın olarak kullanılan smarkartlar bu projede anahtar olarak otomatik kapı açma işleminde kullanılmıştır.

Bu proje www.micropic.es sitesinde yer almakta. Üye olunduktan sonra yazıları anlamak için google traslate veya babel fish transtlation yardımcı olabilir. Programları indirmek için “Descargar(Download)” kısmını takip ederek dosyalara ulaÅŸabiliyoruz.
Access Control chip card (smartcard)
his project is a circuit designed to use a chip card (smartcard) as key.

These cards are very easy to find in many applications, such as prepaid cards for phone booths. Being the control of a relay, its implementation is very open and may be used in an electro-lock replacement as the key boot of a car, which is the concrete example that we shall see below.
Once you understand the overall functioning of the cards we turn to the description of this particular circuit.

It’s simple, by introducing a card into the socket or circuit compares reads the serial number and this allows access or not depending on whether the card is correct or not, there are two incompatible versions of the circuit including the version for cards 8 contacts and version 6 card contacts. The Bytes interest to us can be extracted by pin I / O card.

After feeding the PIC generates a reset and start implementing the programme of internal pic, after configuring ports enters a conditional loop in which not for scanning the RA0 (Insert) to detect the insertion of a card, such detection is done via a switch that has the socket of the card and which is normally closed. When we insert a card this switch that is continuously taking a logical 0 in the RA0 (insert) is opened and by R2 (pull-up) is generated in the RA0 Logical 1 (insert), so the program leaves the Loop and passes to read the state of RA1 (programming).

The move here is fleeting and the program reads the state of conducting a port status, in this there is always a pin 1 Logical thanks to R3 (pull-up) if we press the button programming this creates a logical 0 in RA1 (programming) Well depending on the state of this port to insert the card, the circuit will read the serial number on the card or the EPROM compared with the CIP, suppose that has not been pressed and has been detected on January 1 Logical, as the program continues running and the first thing it does is make 1 Logical port RB0 (reset) and launch a pulse clock through the port RB1 (clock) so that with all this is generating a reset on the card and the meter address it located at position 0, then resumes again 0 Logical RB0 (reset), once initialized card we have to read the serial number on this, as the number is in the position for 40 cards and 32 contacts 8 for 6 of contacts.

We throw the clock pulses to the counter address of the card pointing to the first BIT of the serial number of our card, from here by each pulse clock to generate read in the port RA0 (data) the serial number Three 24-bit bytes bone.

Once you have read all the bits and stored in the memory of variables pic, compared with the first three bytes of the EPROM of the pic, if data are equal will generate a pulse in the port RB7 (allowed) that activates a relay that can be attacking a electrocerradura or whatever we want. But if we are not equal osea card is not authorized a pulse is generated at the port RB6 (noautorizado) and led us to illuminate a indicárnoslo.

After making this process the program re-enters the loop reading the port RA0 (insert), to detect the insertion of another card. For programming the card operation is nearly identical, the only variation is that when the button insert the card program must be pressed to release immediately and we, once you have read the port RA1 (programming) and we detect that performs schedule a reset to the card pointing to the first BIT serial number, reads the serial number, it saves on three variables and is recorded in the first three positions of the EPROM. Once I make it back to loop detection insertion card.

En Çok Okunanlar

Yorum yapın