On Fri, Jul 14, 2017 at 08:50:27PM +0000, Vishal Vaidhyanathan wrote:
Hi Holger,
Well I looked into the code and figured ATMEL MCU used here takes Fi/Di as an input
parameter for setting it’s UART. My question how do you figure the phone clock speed and
baud rate?
the ISO7816 mode of the USART peripheral is used, where the micro-controller doesn't
need to know the clock speed.
compared to UART where both sides need to know the clock speed (asynchronous mode), in
ISO7816 mode there is a dedicated clock signal provided by the phone (synchronous mode)
and the bit is sampled on the rising edge of the clock (no matter the frequency).
the phone (i.e. the master) can change the frequency (1 to 5 MHz at the beginning) while
communicating.
if you are using a simple UART adapter you would have to synchronise to the clock signal
(or measure its frequency using a timer, most of the time this works too).