Question for AtomSoft

Status
Not open for further replies.

Wilksey

Member
Jason,

I have been browsing some of your youtube videos, from a link on here, and saw the amazing card reader that unlocks the PC, great job!

I was wondering if this is an open source project, if it is then I was hoping to find some information on what kind of card reader it is, i.e. RFID, barcode, scanstrip etc, and how you interfaced it with the PC App.

Regards

Wilksey
 
I feel special now... heh my own name in a topic

Um... ill have to look for the source code... give me some time ok... if i cant find it ill try to explain it here
 
Ok cant find it yet but found some code i used to read the card... Basically i used a Smart Card which is like a credit card with a eeprom built in ... now to read it i used
Code:
/************************************
Includes
*************************************/
#include <p18f448.h>
#include <delays.h>
#include <stdio.h>
#include <i2c.h>
#include "lcd.h"

/************************************
Config
*************************************/
#pragma config WDT = OFF, LVP = OFF, OSC = HSPLL

/************************************
Constants / Definitions
*************************************/
#define RA 0xA1     //Read Address
#define WA 0xA0    //Write address

#define CDD PORTDbits.RD0

/************************************
Global Variables
*************************************/
char myName[16];
char myCode[5];

char LcdBuff[17];
//char tempName[6] = {'I','r','e','n','e',0};
//char tempCode[5] = {0x30,0x34,0x35,0x36,0x00};
/************************************
Prototypes
*************************************/
void main(void);
void init_i2c(char speed);
void ReadCard(void);
void WriteCard(char address, char* string);
/************************************
Main
*************************************/
void main(void)
{   
    ADCON1 = 0x0F;			//Digital Pins (we dont need ADC)
    
    TRISA = 0;
    TRISB = 0;
    TRISC = 0;
    TRISD = 0;
    //All Outputs

    LATA = 0;
    LATB = 0;
    LATC = 0;
    LATD = 0;
    //All Low

    CMCON = 0x07;
    TRISDbits.TRISD0 = 1;    //This is the Card Detect
    
    init_i2c(0);
    LCD_Init();


    while(1)
    {
        LCD_LINE(1);
        LCD_STR((unsigned rom char*)"    AtomSoft    ");
        DelayMS(1);

        ReadCard();
        LCD_LINE(2);
        LCD_STR2(myName);

        while(CDD == 1);
        LCD_CLEAR(2);
        DelayMS(100);
    }
}
void WriteCard(char address, char* string)
{
    while(CDD != 1);
    DelayMS(1);

    while(*string)
    {
        EEByteWrite(WA,address, *string++);
        DelayMS(5);
        address++;
    }

    EEByteWrite(WA, address, 0x00);
    DelayMS(5);
}

void ReadCard(void)
{
    char x;

    for(x=0;x<16;x++)
        myName[x] = 0x00;

    for(x=0;x<5;x++)
        myCode[x] = 0x00;

    while(CDD != 1);
    DelayMS(100);

    EESequentialRead(WA,0,myName,16);
    EESequentialRead(WA,16,myCode,5);
}
void init_i2c(char speed)
{
    //Clock is 10MHz w/PLL = 40MHz
    OpenI2C(MASTER, SLEW_OFF);// Initialize I2C module
    
    //KHz = FOSC/(4 * (SSPADD + 1))... or ((FOSC / Speed) / 4) - 1 = SSPADD
    switch(speed)
    {
      case 0:
          SSPADD = 99;   //100KHz 
          break;
      case 1:
          SSPADD = 49;   //200KHz
          break;
      case 2:
          SSPADD = 24;   //400KHz
          break;
    }    
}

Now as a test i used the PIC18F448 but then needed usb so i used a pic18f14k50 since i had some. But you could simple use a USB to UART bridge and accomplish the same thing. Basically you setup a system on you PC of correct codes. Then you program your code into the card(eeprom) then you simply check if the card if inserted on pic micro and if so send the key to the PC... the PC checks and if the key is correct it unlocks your PC... if not it stays locked...

You have to have PIC firmware and PC software made for this...
 
Thanks Jason,

Your projects are very inspiring! espcially since you are doing stuff with FPGA's now, all very interesting stuff, cant wait to see what you come up with next!!

Plus, I could have sent you a PM, but if someone else wants to know about that project then they can refer to this post, is what I figured anyhow!

Thank you for digging out the code and the explanation, I can do the PC side of it no probs, but wasn't 100% sure on how you did the micro interfacing with the reader, I too have some of those chips, as samples from Microchip, amazing company for samples!! They really do take care of the general hobbyist, as with Maxim.

Thanks again!!

Wilksey
 
No problem and i understand about making this a post and not a PM smart move... Thanks, Im actually ordering some FPGA stuff this Monday. As soon as possible i will post my first Blinky LED (hello world) FPGA project with full code and perhaps a video!

Thanks for praise, ill be sure to share as much as possible.
 
I have just started looking at FPGA stuff, downloaded Quartus 2 web edition, all good stuff, better brush up on my logic! lol.
Video would be awesome! Blinky LED is a must for any beginning project I feel, as long as you can make an LED blink you are good go!

Thank you for sharing!! I try and help people out and share bits if I can, but nowhere near as much as someone like yourself, it's not that I dont want to, its just the fact I dont ever manage to find much free time to!

I know other people as well as myself really do appreciate the work that you and others do on this forum to help people out, so it really should be us thanking you!!

Wilksey
 
heh thanks, i actually learned almost everything from this 1 forum. Its a great place and the people are awesome! Let me just say your welcome and i hope i can also help in the future
 
It is, I've looked around on many forums, and this is the one I always come back to, I dont bother looking anywhere else now!

There are some extremely intelligent people on here!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…