Page 1 of 2 12 LastLast
Results 1 to 20 of 32

Thread: Funcard Programmer afternoon project

  1. #1
    Senior Member gw1's Avatar
    Join Date
    Jan 2008
    Location
    Hobart
    Posts
    957
    Thanks
    49
    Thanked 608 Times in 213 Posts
    Rep Power
    268
    Reputation
    1901

    Default Funcard Programmer afternoon project

    Following the recent of funcards I dug a couple out of my junk box to have a play and realised I'd loaned out my "SmartProg DIGIT", the interface I've always used to program blank funcards. What to do? Build a new one of course!

    I had a quick look at half a dozen AVR programmer designs out there for parallel or serial port. Several were similar, and some added a bit more complexity than is strictly necessary unless you're prepared to use a plugpack. I cut back to the basics and ended up with something you can make in an hour or two for around ten bucks. I don't claim any originality here - I've just rehashed what's already out there with a few changes.



    How it works
    Atmel AVR processors support a programming mode using +12V similar to that used by PICs, but most AVR programmers use its serial programming mode which requires nothing more than its usual Vcc which can be anything from 2.7V up to 6V. The serial programming mode involves holding down the processor's RESET pin while clocking the processor as usual, then sending commands using the AVR's ISP (in-system programming) interface consisting of three pins: MOSI (master out, slave in), MISO (master in, slave out) and SCK (serial clock). There are commands to enable programming, erase, read and write code and internal eeprom, lock fuses etc and they're performed by onchip microcode which is why the usual CLK input is still required. I won't get into the nitty-gritty of the programming commands but they're documented in the AT90S8515 datasheet if you're interested.

    Funcards require two additional pins on ISO7816 smartcard socket for the ISP signals: C4 is used for MOSI, and C8 for SCK. I/O pin C7 is used for MISO. Pin C6 (ISO7816 VPP signal) isn't used for either PIC or AVR wafer cards.

    Because all these signals only require TTL voltage levels and the ISP data signals are unidirectional it's a good fit for the PC printer port. A convention emerged years ago for mapping the funcard signals onto the printer port lines. (I'm not sure who authored it - somebody here might know.) Bits D0-D2 are set high during programming operations to provide power for the card. Bit D3 is toggled to provide the card clock, bit D4 provides reset, bit D5 provides data to the card, D6 is used to shift each data bit in turn, while the printer port's ACK input is used to receive data and status information back from the card. The BUSY input is traditionally high when printer is unavailable and low when online, and I've used this for sensing the card presence switch (most software probably won't utilise this though).

    Small current limiting resistors are fitted to D0-D2 to protect the port from misprogramming while the device is plugged in. The cards don't use much current so the drop across the resistors is minimal but they have the effect of amplifying noise in the card's power supply so it's important to fit a capacitor across the card's VCC and GND pins. Some circuits include a zener diode across the power supply but there's no reason for this. The voltage presented to the card is likely to be either 5V or 3.3V depending on the port driver IC on your motherboard or parallel port interface.

    I've also included a status LED to indicate when power is being applied to the card. You'll see that most software only powers the card during read or write sessions and powers down at other times for safe card removal.

    None of the component values I've used are critical, except if you decide to use an electrolytic or tantalum capacitor (I used a multilayer ceramic) be sure to observe correct polarity. Don't reduce the LED current limiting resistor too far or there may be insufficient current left for programming.

    Construction
    There are several ways of building it. I thought about cutting up a printer cable but wedging veroboard into the end of a solder-tag DB25 male connector (Jaycar PP-0840) is more robust and probably quicker in the long run. Double-check your connector pin numbering before beginning and be sure to strip away the copper from beneath the connector pins to avoid shorts.

    All of pins 18-25 on the DB25 connector are ground; you only need to connect one of them. I soldered to several in order to fix the connector more securely.







    To program I normally use XP (SP2 or SP3) and (other versions will probably work too). I use the following configuration:
    • In Settings | Options | Misc
      - enable NT/2000/XP driver (restart afterwards)
    • In Settings | Hardware
      - choose "Fun-Card Programmer"
      - select Windows API
      - leave other settings at default values
    • Choose device "90S8515"
    • Use File | Open File and select your code file (eg "GhostFun v1.0.hex")
    • Use File | Open Data File and select your internal EEPROM file (eg "GhostFun v1.0.eep.hex")


    You will find that IC-Prog is able to detect the processor identifier on your card and will warn you if your selected device type doesn't match the card. 90S8515 and 90S8535 are equivalent for most funcard purposes but they have different identifiers so you may have to experiment.

    If your interface is working correctly you'll be able to successfully perform a verify once you've programmed some files.

    Note that there's no way of programming the external EEPROM data using this interface (no doubt somebody will correct me if I'm wrong here). It does the code and internal EEPROM, but not the external one. To program the latter you need to use a loader; usually the emulator code includes loader functionality. So in other words
    1. Put blank funcard in this interface on your parallel port
    2. Program code and internal EEPROM using IC-Prog
    3. Move the card to a phoenix interface on your serial port
    4. Program external EEPROM using FMCard 4 and CRD files (eg "GhostFun.crd")

    If I remember correctly LMEdit has a GPrep button which loads your external EEPROM for you, ie doing the equivalent of sending GhostFun.crd.

    There are several commercial interfaces which let you specify the external EEPROM hex file at the same time as code and internal EEPROM and they program all three spaces for you at once. My old SmartProg-DIGIT does this, bless its expensive heart. They achieve this feat by first erasing the processor and loading a proprietary loader in order to fill the external EEPROM, and when done they do the code and internal EEPROM. For this reason they aren't able to read or write the external EEPROM without trashing (or at least reading out and rewriting) the internal code & data.

    Have fun!

  2. The Following 7 Users Say Thank You to gw1 For This Useful Post:

    beer4life (28-03-12),CoopsOz (10-06-09),harry5 (12-06-09),kevin1341 (10-06-09),OSIRUS (15-07-09),rebnic (12-06-09),thatslife (12-06-09)



Look Here ->
  • #2
    Premium Member
    OSIRUS's Avatar
    Join Date
    Jul 2008
    Location
    NSW
    Posts
    3,592
    Thanks
    10,571
    Thanked 2,467 Times in 958 Posts
    Rep Power
    1072
    Reputation
    38001

    Default

    Great work gw1,

    & very well explained, Thankyou,

    Cheers

    & only an afternoon project
    Become a Premium Member and support the Austech Forum

  • #3
    Senior Member
    LeroyPatrol's Avatar
    Join Date
    Jan 2008
    Location
    N.E. Vic
    Posts
    16,229
    Thanks
    3,528
    Thanked 4,710 Times in 2,797 Posts
    Rep Power
    1670
    Reputation
    46551

    Default

    great post. These are the posts I really enjoy.

    Leroy

  • #4
    Senior Member
    best4less's Avatar
    Join Date
    Jan 2008
    Location
    Australia
    Posts
    7,684
    Thanks
    3,487
    Thanked 2,207 Times in 1,132 Posts
    Rep Power
    758
    Reputation
    15165

    Default

    Thanks for sharing mate very nice indeed
    When you do things right, people won't be sure that you have done anything at all

  • #5
    Senior Member mickc's Avatar
    Join Date
    Jan 2008
    Location
    newcastle
    Posts
    1,473
    Thanks
    160
    Thanked 201 Times in 139 Posts
    Rep Power
    271
    Reputation
    1154

    Default

    very nice
    you have to much free time

  • #6
    Senior Member
    beer4life's Avatar
    Join Date
    Feb 2008
    Location
    The Nether World.
    Age
    90
    Posts
    6,375
    Thanks
    1,351
    Thanked 1,452 Times in 1,066 Posts
    Rep Power
    560
    Reputation
    7552

    Cool Fantastic!

    Exceeded my wildest dreams.
    Many Thanks and Kindest Regards, " The Druid "......

    PS: Now I wonder why he did that?.....

  • #7
    Senior Member
    Join Date
    Jan 2008
    Posts
    708
    Thanks
    78
    Thanked 121 Times in 75 Posts
    Rep Power
    233
    Reputation
    575

    Default

    Thanks Gw


    My mutant veroboard phoenix interface needed a friend .

  • #8
    Senior Member CoopsOz's Avatar
    Join Date
    Mar 2008
    Location
    Canberra
    Posts
    819
    Thanks
    94
    Thanked 99 Times in 57 Posts
    Rep Power
    235
    Reputation
    607

    Default

    Does anyone know the part number of the smart card socket? TIA.

  • #9
    Senior Member
    fandtm666's Avatar
    Join Date
    Jan 2008
    Posts
    5,502
    Thanks
    244
    Thanked 990 Times in 465 Posts
    Rep Power
    1190
    Reputation
    40447

    Default

    if you are going to build one coops just grab any old useless decoder and take the reader out of that
    dont say linux if i wanted it id install it

  • #10
    Senior Member
    Join Date
    Jan 2008
    Posts
    708
    Thanks
    78
    Thanked 121 Times in 75 Posts
    Rep Power
    233
    Reputation
    575

    Default

    Quote Originally Posted by CoopsOz View Post
    Does anyone know the part number of the smart card socket? TIA.
    Check out rockby electronics Huntingdale $2

  • #11
    Senior Member gw1's Avatar
    Join Date
    Jan 2008
    Location
    Hobart
    Posts
    957
    Thanks
    49
    Thanked 608 Times in 213 Posts
    Rep Power
    268
    Reputation
    1901

    Default

    The circuit is designed for Normally Open contacts - ie contacts close when card is inserted. I used but the (much cheaper) Rockby one should be fine provided it has N.O. contacts, not N.C. The datasheet for Rockby's part is ambiguous, unfortunately, so I recommend you email Rockby for clarification before ordering.

    Normally Open parts are more common. Parts that have card contact pins at 90 degrees to the other pins are typically Normally Closed. Where the card contact pins are parallel to the other pins (though offset by a millimetre or two) it usually means the contacts are Normally Open.

    If scavenging a smartcard socket from dead equipment then it pays to take extra care when desoldering, removing very carefully, because socket pins are easily ripped out and damaged.

    If you have a Normally Closed socket you can still use it: wire the LED cathode to ground, and just leave the socket switch contacts unconnected.
    Last edited by gw1; 10-06-09 at 07:08 PM.

  • #12
    Senior Member CoopsOz's Avatar
    Join Date
    Mar 2008
    Location
    Canberra
    Posts
    819
    Thanks
    94
    Thanked 99 Times in 57 Posts
    Rep Power
    235
    Reputation
    607

    Default

    I built the programmer yesterday and it seems to write the fun files OK but I'm damned if I can get the next step to work. I'm trying to put my goldie details on it using LMedit (via a jaycar mark II) and I'm getting nowhere...any advise?

    BTW, the LED on your parallel port programmer is only to indicate the presence of pwr right? The one I built illuminates when I plug the programmer in but goes out once a card is inserted....is it functioning correctly?

  • #13
    Senior Member
    LeroyPatrol's Avatar
    Join Date
    Jan 2008
    Location
    N.E. Vic
    Posts
    16,229
    Thanks
    3,528
    Thanked 4,710 Times in 2,797 Posts
    Rep Power
    1670
    Reputation
    46551

    Default

    I would expect the opposite. Is your led around the right way?

    Leroy

  • #14
    Senior Member CoopsOz's Avatar
    Join Date
    Mar 2008
    Location
    Canberra
    Posts
    819
    Thanks
    94
    Thanked 99 Times in 57 Posts
    Rep Power
    235
    Reputation
    607

    Default

    It's all sorted now, I had a bit of a error on my pin 11 (busy).....now the led stays on permanently. ICprog verifies successfully and LMedit can write the details, I now have a funcard goldie.....8 yrs after everyone else but I've got one none the less. Thanks all to have helped, especially GW1 for originally posting the cct.

    Now, any truth to the nds funcard rumour?

  • #15
    Senior Member
    LeroyPatrol's Avatar
    Join Date
    Jan 2008
    Location
    N.E. Vic
    Posts
    16,229
    Thanks
    3,528
    Thanked 4,710 Times in 2,797 Posts
    Rep Power
    1670
    Reputation
    46551

    Default

    Quote Originally Posted by CoopsOz View Post

    Now, any truth to the nds funcard rumour?
    That's bin and gone too man.....where were you?

    Leroy

  • #16
    Senior Member
    LeroyPatrol's Avatar
    Join Date
    Jan 2008
    Location
    N.E. Vic
    Posts
    16,229
    Thanks
    3,528
    Thanked 4,710 Times in 2,797 Posts
    Rep Power
    1670
    Reputation
    46551

    Default

    It's a great feeling when you get something built and sorted and then it actually works!

    Leroy

  • #17
    Senior Member CoopsOz's Avatar
    Join Date
    Mar 2008
    Location
    Canberra
    Posts
    819
    Thanks
    94
    Thanked 99 Times in 57 Posts
    Rep Power
    235
    Reputation
    607

    Default

    Quote Originally Posted by LeroyPatrol View Post
    That's bin and gone too man.....where were you?

    Leroy
    Bloody hell, I need to keep a ear closer to the ground me thinks!

  • #18
    Junior Member
    Join Date
    Jun 2009
    Location
    East Gippslnd
    Age
    61
    Posts
    137
    Thanks
    9
    Thanked 1 Time in 1 Post
    Rep Power
    186
    Reputation
    12

    Default QW1 Programmer V1.0

    Nice Product even better than a TPS 3101
    This only for Funcards only not goldies?
    Mick

  • #19
    Senior Member
    LeroyPatrol's Avatar
    Join Date
    Jan 2008
    Location
    N.E. Vic
    Posts
    16,229
    Thanks
    3,528
    Thanked 4,710 Times in 2,797 Posts
    Rep Power
    1670
    Reputation
    46551

    Default

    Quote Originally Posted by mickcc View Post
    Nice Product even better than a TPS 3101
    This only for Funcards only not goldies?
    Mick
    Correct.

    Leroy
    XCRUISER HDSR600HD twin sat and terrestrial receiver $OOS *
    XCRUISER HDSR385 Avant - sold out$OOS UltraPlus DVB-T and DVB-S2 tuners $49 Remotes $OOS

  • #20
    Senior Member
    Join Date
    Jan 2008
    Posts
    708
    Thanks
    78
    Thanked 121 Times in 75 Posts
    Rep Power
    233
    Reputation
    575

    Default

    Why stop guys here why not build the phoenix programmer as well
    No need to buy kits or pre built programmer's .

    Its a bit harder but fun to build .


  • Page 1 of 2 12 LastLast

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •