SIM卡无法识别经验案例
1.问题描述
CPU通过串口无法读出到信息
2、调试经验
上图为CPU与SIM卡通信架构图。在系统实现中,CPU通过TDA8029读取SIM卡信息。
图表 1 SIM卡系统架构图
SIM卡连接电路。
图表 2 SIM卡电路
信号类型 |
功能介绍 |
VCC |
SIM卡的电源脚 |
SIM-CLK |
SIM卡的时钟 一般采用两种时钟,一种是采用13M/4而得的3.25MHz作为基准时钟,一种是采用1.083MHz。 |
SIM-IO |
SIM卡的数据, SIM卡内部的信息传输的通信线 |
SIM-RESET |
SIM卡的工作复位信号, 是用以对SIM卡内部处理器进行复位的。 |
SIM-VPP |
SIM卡的编程供电, |
SIM-GND |
地 |
PRES |
在线检测 |
以上为SIM卡功能实现原理图。
根据以上原理图,分以下几个步骤:
1:从硬件上,确认SIM卡插入卡槽后,SIM卡IC 是否识别?
2:如果SIM卡识别后,软件是否按照规格要求去**SIM卡?
3:CPU是否去读取SIM卡信息?
2.1 分析因素_SIM卡是否被识别
2.1.1 故障分析
插入SIM卡,用示波器检测PERS 电平。SIM卡电平如下:
SIM卡状态 |
PERS电平 |
规格电平 |
备注 |
插入 |
0.8V |
3.3V |
无 |
不插入 |
0V |
0V |
无 |
从PERS电平,可以看出,当SIM卡插入时,PERS信号不正常。仔细阅读Datasheet:
Datasheet描述:
Activation (bit START = 1 in register PCR) is only possible if the card is present (pin PRES is HIGH) and if the supply voltage is correct (supervisor not active).
Pin PRES is internally biased with a current source of 45 A typical to ground when the pin is open (No card present). When PRES pin becomes HIGH, via the detection switch,Connected to VDD, this internal bias current is reduced to 2.5 A to ground. This feature。Allows direct connection of the detect switch to VDD without a pull-down resistor.The presence of the card is signaled to the controller by the HSR.
2.1.2 解决措施
PERS引脚增加10K上拉电阻
2.1.3 经验小结
养成多测试的习惯,Datasheet用于参考。
2.2 分析因素2
2.2.1 故障分析
可以检测到SIM卡,但是无法读到SIM卡信息。
参考Datasheet,了解软件初始化硬件过程:
Activation sequence
When the card is inactive, VCC, CLK, RST and I/O are LOW, with low impedance with respect to GNDC. The DC-to-DC converter is stopped. When everything is satisfactory (voltage supply, card present and no hardware problems), the system controller may initiate an activation sequence of the card.
图表 3 SIM卡**时序
After leaving the UART reset mode, and then configuring the necessary parameters for the UART, it may set the bit START in register PCR (t0). The following sequence will take place:
1:The DC-to-DC converter is started (t1)
2:VCC starts rising from 0 V to 5 V or 3 V with a controlled rise time of 0.17 V/s typically (t2)
3:I/O rises to VCC (t3), (Integrated 14 k, pull-up to VCC)
4:CLK is sent to the card and RST is enabled (t4).
After a number of clock pulses that can be counted with the time-out counter, bit RSTIN May be set by software, then pin RST rises to VCC.
参考Datasheet,了解到SIM卡工作电压为5V,工作电压由TDA8029通过升压电压泵方式实现,测量TDA8029 DC TO DC电源输出。测试发现:
5V输出电平不稳定。
2.2.2 解决措施
DC输出引脚增加104电容用于稳定电压。
PERS引脚增加10K电阻上拉。
2.2.3 经验小结
DC-DC输出端必须接电容,用于稳定电压。