方法1: while((CARD_IN)&&(p<16)) { //读16字节 ReadMainMem(p,buff,16); //读IC卡主存 BreakOperate(); Delay10us(); for(i = 0;i <= 15; i++) printhex(buff); printf("
"); } 方法2: while((CARD_IN)&&(p<16)) { //读16字节 ReadMainMem(p,buff,16); //读IC卡主存 BreakOperate(); Delay10us(); for(i = 0; i < 16; i ++) { SBUF = buff; while(!TI); TI=0; } } void printhex(unsigned char hex)//以十六进制格式输出1个字节 { unsigned char c; c=hex; c=c>>4; printchar(c); c=hex; c=c&0x0F; printchar(c); }
请教: 我用方法1 232 串口软件里显示的:
A2131091FFFF8115FFFFFFFFFFFFFFFF
方法2 232 串口软件里显示的: ? |