English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm playing with an ATMega128 microcontroller and am somewhat confused how one would connect this controller to a component that requires a clock signal? For example, at the moment I'm trying to build a smart card reader. The transmit/receive data pins from the smartcard interface I can simply connect to the i/o ports of the microcontroller board. The smartcard requires a clock signal and I was originally hoping to simulate one using a pulsing i/o signal from the ATmega, however someone else advised me they had tried and not found success. Instead, using a crystal was recommended. My electronics knowledge is a little thin -- I can visualize how one would connect a clock to the smartcard reader interface if it was standalone, but it seems like the clock would also need to communicate with the microcontroller somehow? The microcontroller is running off it's own crystal at the moment. Any help/advice is appreciated. Thanks :)

2007-03-01 03:39:37 · 4 answers · asked by mdigitale 7 in Science & Mathematics Engineering

4 answers

You definitely want synchronous operation of the microcontroller and the card reader, so you're going to need to either share a clock or have the ATMega128 generate it.

If you can't use the USART or serial interfaces built into the ATMega128 (these two types of communication use a clock) there may be two other options. The data sheet indicates that XTAL2 can be used to drive a second clock buffer when the CKOPT is high (they say programmed)(datasheet pg38). This means you should be able to hook up the crystal to two devices at the same time (in parallel).
If this doesn't work or you want to run the card reader at a slower rate than the ATMega128 you could use one of the PWM outputs with a 50% duty cycle as a clock line to the card reader (this should be a set-and-forget option).

I don't know if this is an option for you but there are other microcontrollers which have clock outputs designed for your type of application. If switching microcontroller brands is something you want to look into I would try Microchip's PIC18 line. These chips don't even need crystals to run up to 8 MHz.

2007-03-01 06:51:45 · answer #1 · answered by Anonymous · 0 0

There is confusion about two different "clocks" and you need to check what applies to you. There is an operating clock and a data clock. The operating clock is the one that is running off a crystal and is used by each of the chips to carry out the program or algorythm used in processing. The data clock is the one that guarantees the communication between the chips is valid. What you proposed to do originally was have the MPU pulse a line when it was ready and read the data the cardreader suppled, so you would be clocking the reader rather slowly. What someone else said was that the reader needs a highspeed clock to function. Normally, you should be able to look at the pin designations on the reader for interface clues. If it reads bytewise, then there should be a data ready line that the MPU reads. If it is serial, then there may still be a data readly line, but there will be a data clock or other line that is to be pulsed and with each pulse it will deliver one data bit.

2007-03-01 03:58:26 · answer #2 · answered by Mike1942f 7 · 0 0

If the microcontroller clock pulses at the desire speed or is at an acceptable speed that the smart card requires, then why not jumper the two devices together. That is, use the same clock for the microcontroller and the smartcard. Same clock with two wires. You can also connect another clock (crystal) to the smart card. Make sure that the clok pin on the smart card is not already connected to something else. Then just add the clock to it. All you need is to share the same supply and ground. Is as simple as just adding a wire. Well, make sure the siganals are compatible. There are current limitations within each device so you will have to take that into account as well.

Oh, yeah, it helps if both devices share the same power suply and ground.

2007-03-01 03:52:00 · answer #3 · answered by mr_gees100_peas 6 · 0 0

i think of of that i ought to touch Western digital in this. have you ever tried to hook thecontinual to a various workstation and then load residing house homestead windows? If it particularly works on yet yet another workstation than your mobo is the priority. optimum in all probability the sata plugs have a malfunction, or a capacitor is out. Are the sata cable ends thoroughly seated? Does thecontinual format somewhat at present?

2016-12-18 03:17:13 · answer #4 · answered by ? 4 · 0 0

fedest.com, questions and answers