Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Crystal Question

Status
Not open for further replies.

TKS

New Member
If you see in a device spec that the HS freq max=20Mhz.

means this that you can use also 16Mhz??

i search for a way to produce a 8Mhz clock source for a 16F84a (gold smartcard)

any one answers??

Thanxs

TKS
 
Using a lower frequency crystal then the max rating is fine, just keep in mind that you will have different timing in your software delays.
 
TKS said:
If you see in a device spec that the HS freq max=20Mhz.

means this that you can use also 16Mhz??

i search for a way to produce a 8Mhz clock source for a 16F84a (gold smartcard)

any one answers??

Yu can use any clock less than the maximum, in fact for a PIC you can go right down to a DC 'clock'. If you're using the in-built oscillator, you have to alter the config fuse settings - HS for high speed crystals, and XT for crystal - however, there's no clear division where you should swap over. Cetainly 20MHz is HS and 4HMz is XT, I would suggest trying HS above 10MHz.

For your goldcard, as far as I'm aware, they use an external clock - fed in on one of the card pins - so you simply require an external 8MHz oscillator feeding the correct pin, and set the PIC to use an external oscillator.
 
can you explain

please the last part a bit more?

can i just hookup the pic osc outlet to the other card RB6???

(in the card RB6= conected to the external clock line. pin 12 (16F84a)



the problem is that i need to program all the stuff with compilers and they don't accept Xtal =2 or 1 soo i cant use the normal Fosc / 4 function

expect if i clock it @ 16Mhz..and that number is accepted soow that could be a solution or not??

TKS

for better signal strengt higer caps?? or lower?? i now use 33pF
 
Re: can you explain

TKS said:
please the last part a bit more?

can i just hookup the pic osc outlet to the other card RB6???

I'm not very clear about what you'r plugging the goldcard into, I presume from this it's something containing a PIC?.

There used to be a technical bulletin at MicroChip, showing you how to use one xtal to run two PIC's, from what I remember you basically just connect the output of the one with the xtal, to the input of the other.

As this is going to be on a card, through a socket, you may need to buffer the oscillator output of the PIC with the xtal.

(in the card RB6= conected to the external clock line. pin 12 (16F84a)



the problem is that i need to program all the stuff with compilers and they don't accept Xtal =2 or 1 soo i cant use the normal Fosc / 4 function

expect if i clock it @ 16Mhz..and that number is accepted soow that could be a solution or not??

Surely your compiler should be able to accept different clock frequencies?.

for better signal strengt higer caps?? or lower?? i now use 33pF

I don't see any need to change them.
 
Look @ this please...

I have added the goldcard layout

and a bit of section about the 16F84a data sheet.

soow now you untherstand better.

also i need a solution for 1 wire communication i was thinking about serial

but changing the same pin to tx and to rx..???

i will need RB7 to do this....

or should i just make a simple pin hihg low timing part???

if i just grab a 20Mhz cristal how should i connect that one to the card??

1 pin of the crystal to vdd (5volt) and the other to the input on pic??

and both to VSS with cap??

TKS
 

Attachments

  • goldcardinfo.gif
    goldcardinfo.gif
    14 KB · Views: 753
  • 84ainfo.jpg
    84ainfo.jpg
    21.6 KB · Views: 751
Re: Look @ this please...

TKS said:
I have added the goldcard layout

and a bit of section about the 16F84a data sheet.

soow now you untherstand better.

also i need a solution for 1 wire communication i was thinking about serial

but changing the same pin to tx and to rx..???

i will need RB7 to do this....

Obviously there's not a great deal of choice, as there are only RB6 and RB7 available, but generally one would be used as a serial input, and the other as a serial output. My tutorials give suitable code to do this, although you may need to adjust the bit timing depending on your clock speed.

If you wanted to do bi-directional serial I would suggest using a pull-up resistor on the line, and both connections set as inputs. To initiate a serial transmisson the sending device changes it's pin to an output, and pulls it low - this becomes the start bit for the serial transmission. Once it's done sending data the pin is returned to an input again.

or should i just make a simple pin hihg low timing part???

if i just grab a 20Mhz cristal how should i connect that one to the card??

1 pin of the crystal to vdd (5volt) and the other to the input on pic??

and both to VSS with cap??

You can't add a crystal to the card, you need an external oscillator - this is usually provided by the cardreader circuit it plugs in to.

Do you have some reason for wanting to use a 20MHz clock?, PIC's usually send almost all of their working life sat wasting time - so unless you have an urgent need for maximum speed 4MHz is usually plenty.
 
ok

ok i have it now running on 20Mhz wy??

because the other chip use it also has :D (16F818/9) if i will use the internal ocs it will be 8 if output it it will be 2?? 2 my compiler doesn't accept. i can buy a 4Mhz external one that will help.

back:
soow i loaded a test prog in it

RB7 high for 1 sec and then low for 1 sec etc..

it works

but!!

you forgot one thing i think.

RB6 is conected to pin 16 on the card soow if i use that one for serial comm my OSC input goes wrong right??

soow i only have 1 wire to communicate.

i don't untherstand wy the hell they didn't use some more contacts on the card to the other pins... :cry: :cry: :cry:

what would you suggest for 1 wire communication....?? a simple timing routine?? or would you do some communication routine??

i need to do something soow it is unique..

maybe i didn't tll its a wafer type card..soow i don't have acces to the chips..


p.s. one thing i already learnd is you have to put RB6 to input mode if you don't it will be high and then it braks the osc input signal...

basicly rb6i only used for programming.
RB7 is then left for comm.

TKS


p.s. if i code protect the card it isn't possible to read the code right? now one exept microchip maybe???
 
Re: ok

TKS said:
ok i have it now running on 20Mhz wy??

because the other chip use it also has :D (16F818/9) if i will use the internal ocs it will be 8 if output it it will be 2?? 2 my compiler doesn't accept. i can buy a 4Mhz external one that will help.

I'm a bit confused by that?, the input and output are the same frequency, it's the internal clock speed which is 1/4 of the crystal - everything external is at the full crystal frequency. It's VERY common for the internal processor to run at a fraction of the clock speed, almost all do - the Z80 ran particularly slow.

If you have one PIC running with a 20MHz crystal, and link it's output to the clock input of the goldcard, then the goldcard will run at 20MHz as well (and internally at 5MHz - just like the first one).

back:
soow i loaded a test prog in it

RB7 high for 1 sec and then low for 1 sec etc..

it works

but!!

you forgot one thing i think.

RB6 is conected to pin 16 on the card soow if i use that one for serial comm my OSC input goes wrong right??

Yes! - sorry about that, I hang my head in shame!! :oops:

soow i only have 1 wire to communicate.

i don't untherstand wy the hell they didn't use some more contacts on the card to the other pins... :cry: :cry: :cry:

Because of what the card is, it's designed to use the standard connections for a smart card - so it's pretty pointless adding extra non-standard ones.

what would you suggest for 1 wire communication....?? a simple timing routine?? or would you do some communication routine??

i need to do something soow it is unique..

The usual point of them is to use a standard communication protocol, so it can connect with a standard card reader - it's what the card does with the data that's important - not the communication link.

What are you actually trying to do?.

maybe i didn't tll its a wafer type card..soow i don't have acces to the chips..

I presumed that, I've seen them advertised for satellite decryption cards.

p.s. one thing i already learnd is you have to put RB6 to input mode if you don't it will be high and then it braks the osc input signal...

Yes, if it's set as an input it's high impedance, and won't affect the clock, if it's an output it's low impedance (if it's high, or if it's low), this will obviously kill the clock signal.

basicly rb6i only used for programming.

True :oops:

RB7 is then left for comm.

p.s. if i code protect the card it isn't possible to read the code right? now one exept microchip maybe???

It's certainly not easily possible, if you search hard enough you can find various schemes for breaking protection on any processors, but PIC's are probably as secure as most.
 
:D:D

Yeah Ok,

and without acces to the pins exept the 8....


well i'm making a acces device soow i only need to be sure that i recon my card if its inserted..and then give that one acces the ****...

already have put 2 leds to the cardreader they are flashing..and guess what....the think is in sadable?? (the way you feel if you run hard 1Mile)

:D:D

now a bit of timing stuff and i wil let it here by...

ahh do you think its wise to put a resistor between VDD and the card reader?? or will any other card have the same pinlayout???
 
ahhh..

the cardreader is conected via a RS485 network to the main chip...

wich controls relais and display etc...

do you know a good source for 485 info i'm a bit strugling with that...
i alreadylooked here at the forum but didn't came up with much..

for example wich res value to use (rt in the max sheets..)

TKS
 
Status
Not open for further replies.

Latest threads

Back
Top