Oh, sorry, too tired, i fall asleep
Actually I am trying to interface a SMART card. As we know, smart card contains a uC as well. Some one even use PIC to emulate the smart card.
The smart card has one IO pin and one ClK pin.
I connected the ClK pin like the one shown.
Initially, every time i send a bit, i will send a clock pulse (PIN_CLK = 1, then PIN_CLK=0). But this doesn't work. Maybe because the CLK is not 50% duty cycle.
The start up sequence for Smart card is stated in iso 7816-3, in the section ISO7816 3.2.b - Reset of the card
https://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-3.aspx
I send the pulses however, The IO pin always high.
That's make me thinking of using another XTAL for the smart card. The problem is, if I use another XTAL, the timing become hard to follow as I am using CCS PIC-C.
I found a smart card Interface IC driver, writen in C. I guess this is possible to use PIC-C to write the driver.
http://www.gemplus.com/products/gemcore_chipset/resources/reader_driver.html
I am using NCN6001 from ON SEMI. Initially I wish to use Gemplus IC, since they have a C driver. but unfortunately, they ignored my request for IC and eval board