PDA

View Full Version : goldcard



tiger_bel
- 8th June 2006, 02:02
hello,
first post ever,
i am trying to write a goldcard program ( PIC16F84)
communication between 18F4525 and card,
the program in the card wait for a string of 16 bytes and answer with a 16 bytes string.
the 16F84 never answer ??.

replacing the card by a pc with hypert. and it works fine - even at 9600bp so soft in 4525 seems ok.

cardsoft prog for info
what's the mistake ???

paul borgmeier
- 8th June 2006, 15:40
tiger_bel,

A few things but probably (or should I say definitely) not all....

Your attached program does not compile without errors for the 16F84 - how did you test it?

Variables temp and temp1 used in loops not declared – add
temp var byte
temp1 var byte

your program uses Call to get to your Basic subroutines. Call looks for ASM code. For example, Call del100ms looks for an ASM routine marked _del100ms. You probably want to change them to Gosub

Your Pauseus 1 really is not 1 us but 24 uS. See manual. Change to @ nop

Maybe other can see more, especially in regards to the serial part – off to work for me (and I will look later tonight at your logic).

Paul Borgmeier
Salt Lake City, Utah
USA

tiger_bel
- 8th June 2006, 22:56
thanks for the tips.
temp - lost by cut and paste !!
already implemented and tested.

some remarks anyway....

for the pic 4525 sending to goldcard one stream of 16 bytes takes 133,2 ms on the ossiloscope.
the pic 16F84 use the same oscillator of 4 mhz ( RB6/ osc) on the chipcard, and the same program but serin masked out - pic will send always the answer .
The same stream takes 149,6 ms , there is no match in the baudrate. why ?
it is not the pause between bytes send , normally 1 stopbit.
The difference is in each bit send. one byte takes 9,25ms.
i see a difference in high and low time for $55 - normally it must be a square wave !( for 4 periods at least )

I did'nt read this remark in another topic on the board

regards
Harry

tiger_bel
- 9th June 2006, 01:23
problem solved.... (how stuped)

set the configuration bit osc HS insteed of XT
and reading ,writing - all ok...
up to the next problem ....

thanks for the help
regards

harry