• AVR Freaks

Helpful ReplyHot!USB Smart Card reader

Page: 12 > Showing page 1 of 2
Author
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
2013/07/01 15:24:37 (permalink)
0

USB Smart Card reader

I was looking into the MAL for a USB Smart Card reader, such as those used for Identification: these days we have some need for such a device in Italy for bureaucratic... activities Smile , so I'd like to build it using PICs and the rest (not much I'd say).
I can't find such a code, and now I am not sure if a "standard" USB class exists, but I'd say it does (I will check more on google tomorrow).
So my question is: does such a code exist? Anybody did a similar thing?
I actually can see a "Smartcard library" in the MAL, but it's a "standalone" thing..
 
thanks Smile

GENOVA :D :D ! GODO
#1
chinzei
Super Member
  • Total Posts : 2250
  • Reward points : 0
  • Joined: 2003/11/07 12:39:02
  • Location: Tokyo, Japan
  • Status: offline
Re:USB Smart Card reader 2013/07/01 17:07:59 (permalink)
0
C:\microchip_solutions_v2013-02-15\USB\Device - CCID - Smart Card Reader

Appnote:
Smart Card Communication Using PIC MCU
http://ww1.microchip.com/...en/AppNotes/01370A.pdf

USB spec:
Smart Card CCID version 1.1
http://www.usb.org/develo...t-Card_CCID_Rev110.pdf

Windows have in-box driver (may be required to be "updated")
For the details,
C:\microchip_solutions_v2013-02-15\USB\Device - CCID - Smart Card Reader\Driver Readme\Readme.txt

Android
MifareClassic
http://developer.android....ech/MifareClassic.html
MifareUltralight
http://developer.android..../MifareUltralight.html

or,
Are you looking for PIC host code?

Tsuneo
post edited by chinzei - 2013/07/01 17:28:50
#2
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re:USB Smart Card reader 2013/07/02 00:59:20 (permalink)
0
Thank you very much Tsuneo Smile as usual!
I only had apr 2012 MAL, but the "CCID" thing mislead me (and it was also late yesterday night...)
So I am downloading new MAL just to be up-to-date.
 
And yes, Windows host will be more than good at least to begin with!
Will try and report back..

GENOVA :D :D ! GODO
#3
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re:USB Smart Card reader 2013/07/07 02:10:25 (permalink)
0
Created test PCB with a PIC18F2550, burnt the firmware after some little adapting... everything ok. Now I am waiting for card-holder samples ... !

GENOVA :D :D ! GODO
#4
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re:USB Smart Card reader 2013/07/11 05:57:28 (permalink)
0
Hmm, Tsuneo or anyboady else... can you point me to a Windows software to check if my reader is working? can't seem to find one... !
 
thx

GENOVA :D :D ! GODO
#5
chinzei
Super Member
  • Total Posts : 2250
  • Reward points : 0
  • Joined: 2003/11/07 12:39:02
  • Location: Tokyo, Japan
  • Status: offline
Re:USB Smart Card reader 2013/07/13 07:10:49 (permalink)
#6
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re:USB Smart Card reader 2013/07/13 10:03:24 (permalink)
0
Perfect, many thanks Smile
 
In the meanwhile, I tried some 3 utilities that could not handle the USB device; then one (from a commercial device' CD) did see it and let me check it up to ATR.
 
Then I tested with a real life authentication site, and I can go somewhat well up to some point where I get an "internal reader error"... not sure why. Now I'll go on with tests!

GENOVA :D :D ! GODO
#7
ACPC
Starting Member
  • Total Posts : 65
  • Reward points : 0
  • Joined: 2010/05/27 07:24:57
  • Location: 0
  • Status: offline
Re:USB Smart Card reader 2014/04/21 16:57:39 (permalink)
0
Dario,
 
Did You found a Windows software to check if USB SC reader is working?
 
Best Regards
 
ACPC
post edited by ACPC - 2014/04/21 17:02:23
#8
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re:USB Smart Card reader 2014/04/22 02:49:14 (permalink)
0
Hi,
no in the end I let it down, solved my issue with a commercial device...
 
I guess it is some issue in the USB stack. I may check with latest versions...

GENOVA :D :D ! GODO
#9
ACPC
Starting Member
  • Total Posts : 65
  • Reward points : 0
  • Joined: 2010/05/27 07:24:57
  • Location: 0
  • Status: offline
Re:USB Smart Card reader 2014/04/22 04:38:11 (permalink)
+1 (1)
"Microsoft USBView" is showing the PIC32 USB is connected.
 
 
 I'm going to study MCHPFSUSB v2.9j
 

Best Regards
 
ACPC
post edited by ACPC - 2014/04/22 04:52:36
#10
kilroy
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2013/04/16 12:13:06
  • Location: 0
  • Status: offline
Re: USB Smart Card reader 2014/04/23 23:23:49 (permalink)
0
Has anyone managed to get the CCID Smart Card Reader code to work for a PIC32? I have tried it several times over, Explorer Board (PIC32MX795F512L PIM) and PIC32 USB Starter Kit III (PIC32MX795F512L) with no luck on either using the code provided in microchip_solutions_v2013-06-15 as the newer version doesn't have it. I can get the device to enumerate but it won't properly recognize any card I put into it and there are some odd behaviours I see on bus analysis. The code seems to be not quite right for PIC32, maybe it was touched in house for PIC18 last and had something broken for PIC32. For instance, I am pretty sure it is computing the baud rate incorrectly as I tried using the DEBUG uart routines and found they were at a baud rate other than the one stated in the #define.
 
If you know of a successful implementation, can you point me in the direction of the code used?
 
If there is no feedback on this front, I'll get much more specific about the problems I see based on bus analysis.
 
THANKS! - Dan (Kilroy)
#11
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re: USB Smart Card reader 2014/04/24 02:07:51 (permalink)
0
Looks like a Card interfacing issue, then?
Voltage, signalling etc?

GENOVA :D :D ! GODO
#12
kilroy
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2013/04/16 12:13:06
  • Location: 0
  • Status: offline
Re: USB Smart Card reader 2014/04/24 22:04:52 (permalink)
0
On startup there is power to the card slot. Just to be sure I grabbed a brand new copy of the code and compiled it anew and programmed the Explorer 16 board with it. I then watched it with a bus analyser (Beagle) to see what was going on. The unit starts up and gets through enumeration OK, so on both my Windows and Linux machines it is listed in the connected devices and the analyser shows pretty normal behaviour. BUT, once the device transitions from setup to Configured state the slot power goes off and the bus analyser shows a LOT of strange data on the USB lines, orphaned data, bad PID, and a constant stream of it. If I plug in a normal CCID I see the same progression of enumeration but, without a card in the slot, there is only a few back and forths that are card slot status request and responses and all goes quiet. The Microchip demo carries on spewing garbage onto the USB bus, so it seems, and never stops. I am now digging into the code to try and workout what it going wrong but would rather start with working code and move on to my own project. Many thanks for any suggestions and am happy to answer questions... I am using XC32 and wonder if the code doesn't work with that compiler as configured.
#13
kilroy
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2013/04/16 12:13:06
  • Location: 0
  • Status: offline
Re: USB Smart Card reader 2014/04/25 00:07:35 (permalink)
0
A little update. I went back a version and had some better luck. I had been using the Smart Card code from the USB Framework in MLA version v2013-06-15 (the Smart Card Demo isn't in the newest MLA v2013-12-20).
 
Now I tried the earlier version from v2013-02-15 and sure enough that one almost works. I still can't get it to read a card and see some peculiarities on the bus but it is much better behaved. Going through the archives now it seems a lot of effort has been made over the versions to wrestle bugs out of this code and I wonder if, now that the demo is not in the framework at all any more, if the code might not be fully functional for all the selectable platforms. My working hunch anyway. I am glad to have what is there it beats starting from scratch, but I am still struggling with it and hope achieve a fully working demo... Compiler? Bugs? Me? Don't know.
#14
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re: USB Smart Card reader 2014/04/25 03:44:21 (permalink)
0
I guess I used 02/2013 version too, but on a PIC18...

GENOVA :D :D ! GODO
#15
kilroy
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2013/04/16 12:13:06
  • Location: 0
  • Status: offline
Re: USB Smart Card reader 2014/04/27 16:07:36 (permalink)
+1 (1)
For the record, I am now using using Framework v20130615 and substituted main.c from v20130215 to get rid of most of my problems. The changes stated for that file say the change was:
  2.9j  Updates to support new bootloader features (ex: app version
        fetching).


As I am totally rewriting main.c anyway at this point I need to get moving forward I won't get the chance to pin it down to the exact lines but that should get someone close if they find there way here to this problem (Microchip USB CCID Smart Card Reader not working for PIC32) cheers, Dan
#16
maxruben
Super Member
  • Total Posts : 3342
  • Reward points : 0
  • Joined: 2011/02/22 03:35:11
  • Location: Sweden
  • Status: online
Re: USB Smart Card reader 2014/04/27 23:52:45 (permalink)
+1 (1)
Are you using the stack in interrupt mode? Does it work in polling mode? Someone here reported that the wrong interrupt bits was used for some PIC32s in the latest stack.
 
http://www.microchip.com/forums/FindPost/793763
 
/Ruben
#17
kilroy
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2013/04/16 12:13:06
  • Location: 0
  • Status: offline
Re: USB Smart Card reader 2014/04/28 09:05:11 (permalink)
0 (1)
Yeah I can use polling or interrupt mode that seems to be OK. I seem to have other problems where sometimes it boots and works and other times it goes into a mad state of crazy nonsensical USB bus activity. I am not 100% sure that is unrelated to the other problems I saw, maybe just start up, brown out, some kind of reset or initialization not handled well. But that is all off topic here I suspect and anyway of the "ordinary" development path problems.
 
#18
ACPC
Starting Member
  • Total Posts : 65
  • Reward points : 0
  • Joined: 2010/05/27 07:24:57
  • Location: 0
  • Status: offline
Re: USB Smart Card reader 2014/05/03 14:26:30 (permalink)
0
Dan,

Next week I will start my studies with ETHERNET STARTER KIT.
 
PIC32 web server to read simple things such as ATR can be a good help.

I compiled Device - CCID - Smart Card Reader (version MLA V2013-06-15) for ETHERNET STARTER KIT and everything was OK.

Now I need to adapt a smart card slot in my kit, I dont have Smart Card PICtail Daughter Board
 
Best Regards
ACPC
#19
ACPC
Starting Member
  • Total Posts : 65
  • Reward points : 0
  • Joined: 2010/05/27 07:24:57
  • Location: 0
  • Status: offline
Re: USB Smart Card reader 2014/05/03 14:37:52 (permalink)
0
Dan,
 
Is not clear to me if you tested with DSO pins 1,2,3 and 7 of the smart card.
You only tested the USB communication?
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5