基于 MiniLA 的移植与实现 (3)
来源:互联网 发布:微信选课系统源码 编辑:程序博客网 时间:2024/06/09 13:50
为了方便测试,我将PowerPC上的信号SMC1_TXD在经过RS232电平转换器件之前接到了FPGA的IO上,下面是具体的测试过程: 1. 通过Telnet链接到板卡上 2.下载FPGA配置文件 tinysh$ fpga download la_top.bin File check passed [==================================================>] 100 % tot_len = 336680
3.开始捕获数据
tinysh$ miniLA
tinysh$ miniLA > start
4.这个时候我们在串口上进行一些操作。
# cat /proc/cpuinfo
processor : 0
cpu : 8280
core clock : 332 MHz
CPM clock : 249 MHz
bus clock : 83 MHz
revision : 32.19 (pvr 8082 2013)
bogomips : 221.18
5. 停止数据捕获
tinysh$ miniLA > stop
Spend time :[4209]ms Rate:[2]kB/S
tinysh$ miniLA > /q
tinysh$
Bye
6. 这个时候我们就得到了捕获的数据
# ls /mnt/rd/ -l
-rwxr-xr-x 1 0 0 11264 Jan 1 02:39 minila.bin
该数据是一个原始的采样值,为了能在minila_win_0.6.3_src软件上显示,还需要给该文件加个文件头。
用VC做个小程序,代码如下:
#include "stdafx.h"
char FileSig2[] = "MINILA0/0";
FILE * gInpfile = NULL;
FILE * gOutpfile = NULL;
#pragma pack(1)
typedef struct {
unsigned int dataLen;
unsigned char stateAnalysis;
double timeBase;
unsigned int cursorsPositionL;
unsigned int cursorsPositionH;
unsigned char trigSize;
unsigned char trigDelay;
unsigned char trigLen;
unsigned int trigMask;
unsigned int trigValue;
unsigned int trigEdge;
unsigned char extTrig_en;
unsigned int extTrig_val;
unsigned char invIntTrig;
} algFileHeader_t;
#pragma pack(push)
int genFileHeader(FILE* in, FILE* out)
{
int dataLen = 0;
unsigned int sample_temp = 0;
algFileHeader_t header;
fseek(in, 0, SEEK_END);
dataLen = ftell(in);
fseek(in, 0, SEEK_SET);
header.dataLen = dataLen / 4;
header.stateAnalysis = 1;
// header.timeBase = 100000000;
// header.timeBase = 83333333;
header.timeBase = 41666667;
header.cursorsPositionL = 0;
header.cursorsPositionH = 0;
header.trigSize = 0;
header.trigDelay = 1;
header.trigLen = 1;
header.trigMask = 0;
header.trigValue = 0;
header.trigEdge = 0;
header.extTrig_en = 0;
header.extTrig_val = 0;
header.invIntTrig = 0;
fwrite(FileSig2, 8, 1, out);
fwrite((void *)&header, 1, sizeof(algFileHeader_t), out);
for(unsigned int i=0; i<header.dataLen; i++)
{
fread(&sample_temp, 1, 4, in);
fwrite(&sample_temp, 1, 4, out);
}
return 0;
}
int main(int argc, char* argv[])
{
gInpfile = fopen("minila.bin", "rb");
gOutpfile = fopen("data.alg", "wb");
genFileHeader(gInpfile, gOutpfile);
fclose(gInpfile);
fclose(gOutpfile);
return 0;
}
这时将输出的data.alg文件用minila_win_0.6.3_src打开就可以看到下面的波形。明显看到波形分为两段,前面的是我通过PC向板卡发送命令(信号SMC1_RXD),板卡回显过来的数据(信号SMC1_TXD)。通过RS232-Decoder可以识别出这段信号的含义。
下面为完整的Decoder结果,和我们在串口软件上看到的内容一致。
122301442 (2.94s) start of decoding
127810737 (3.07s) 0x63 c
127814363 (3.07s) 0x61 a
127817990 (3.07s) 0x74 t
127821617 (3.07s) 0x20
127825243 (3.07s) 0x2F /
127828870 (3.07s) 0x70 p
127832497 (3.07s) 0x72 r
127836123 (3.07s) 0x6F o
127839750 (3.07s) 0x63 c
127843377 (3.07s) 0x2F /
127847003 (3.07s) 0x63 c
127850630 (3.07s) 0x70 p
127854257 (3.07s) 0x75 u
127857883 (3.07s) 0x69 i
127861510 (3.07s) 0x6E n
127865137 (3.07s) 0x66 f
127868763 (3.07s) 0x6F o
127872390 (3.07s) 0x0D
127876017 (3.07s) 0x0A
128144390 (3.08s) 0x70 p
128148017 (3.08s) 0x72 r
128151643 (3.08s) 0x6F o
128155270 (3.08s) 0x63 c
128158897 (3.08s) 0x65 e
128162523 (3.08s) 0x73 s
128166150 (3.08s) 0x73 s
128169777 (3.08s) 0x6F o
128173403 (3.08s) 0x72 r
128177030 (3.08s) 0x09
128180657 (3.08s) 0x3A :
128184283 (3.08s) 0x20
128187910 (3.08s) 0x30 0
128191537 (3.08s) 0x0D
128195163 (3.08s) 0x0A
128198790 (3.08s) 0x63 c
128202417 (3.08s) 0x70 p
128206043 (3.08s) 0x75 u
128209670 (3.08s) 0x09
128213297 (3.08s) 0x09
128216923 (3.08s) 0x3A :
128220550 (3.08s) 0x20
128224177 (3.08s) 0x38 8
128227803 (3.08s) 0x32 2
128231430 (3.08s) 0x38 8
128235057 (3.08s) 0x30 0
128238683 (3.08s) 0x0D
128242310 (3.08s) 0x0A
128245937 (3.08s) 0x63 c
128249563 (3.08s) 0x6F o
128253190 (3.08s) 0x72 r
128256817 (3.08s) 0x65 e
128260443 (3.08s) 0x20
128264070 (3.08s) 0x63 c
128267697 (3.08s) 0x6C l
128271323 (3.08s) 0x6F o
128274950 (3.08s) 0x63 c
128278577 (3.08s) 0x6B k
128282203 (3.08s) 0x09
128285830 (3.08s) 0x3A :
128289457 (3.08s) 0x20
128293083 (3.08s) 0x33 3
128296710 (3.08s) 0x33 3
128300337 (3.08s) 0x32 2
128303963 (3.08s) 0x20
128307590 (3.08s) 0x4D M
128311217 (3.08s) 0x48 H
128314843 (3.08s) 0x7A z
128318470 (3.08s) 0x0D
128322097 (3.08s) 0x0A
128325723 (3.08s) 0x43 C
128329350 (3.08s) 0x50 P
128332977 (3.08s) 0x4D M
128336603 (3.08s) 0x20
128340230 (3.08s) 0x20
128343857 (3.08s) 0x63 c
128347483 (3.08s) 0x6C l
128351110 (3.08s) 0x6F o
128354737 (3.08s) 0x63 c
128358363 (3.08s) 0x6B k
128361990 (3.08s) 0x09
128365617 (3.08s) 0x3A :
128369243 (3.08s) 0x20
128372870 (3.08s) 0x32 2
128376497 (3.08s) 0x34 4
128380123 (3.08s) 0x39 9
128383750 (3.08s) 0x20
128387377 (3.08s) 0x4D M
128391003 (3.08s) 0x48 H
128394630 (3.08s) 0x7A z
128398257 (3.08s) 0x0D
128401883 (3.08s) 0x0A
128405510 (3.08s) 0x62 b
128409137 (3.08s) 0x75 u
128412763 (3.08s) 0x73 s
128416390 (3.08s) 0x20
128420017 (3.08s) 0x20
128423643 (3.08s) 0x63 c
128427270 (3.08s) 0x6C l
128430897 (3.08s) 0x6F o
128434523 (3.08s) 0x63 c
128438150 (3.08s) 0x6B k
128441777 (3.08s) 0x09
128445403 (3.08s) 0x3A :
128449030 (3.08s) 0x20
128452657 (3.08s) 0x38 8
128456283 (3.08s) 0x33 3
128459910 (3.08s) 0x20
128463537 (3.08s) 0x4D M
128467163 (3.08s) 0x48 H
128470790 (3.08s) 0x7A z
128474417 (3.08s) 0x0D
128478043 (3.08s) 0x0A
128481670 (3.08s) 0x72 r
128485297 (3.08s) 0x65 e
128488923 (3.08s) 0x76 v
128492550 (3.08s) 0x69 i
128496177 (3.08s) 0x73 s
128499803 (3.08s) 0x69 i
128503430 (3.08s) 0x6F o
128507057 (3.08s) 0x6E n
128510683 (3.08s) 0x09
128514310 (3.08s) 0x3A :
128517937 (3.08s) 0x20
128521563 (3.08s) 0x33 3
128525190 (3.08s) 0x32 2
128528817 (3.08s) 0x2E .
128532443 (3.08s) 0x31 1
128536070 (3.08s) 0x39 9
128539697 (3.08s) 0x20
128543323 (3.09s) 0x28 (
128546950 (3.09s) 0x70 p
128550577 (3.09s) 0x76 v
128554203 (3.09s) 0x72 r
128557830 (3.09s) 0x20
128561457 (3.09s) 0x38 8
128565083 (3.09s) 0x30 0
128568710 (3.09s) 0x38 8
128572337 (3.09s) 0x32 2
128575963 (3.09s) 0x20
128579590 (3.09s) 0x32 2
128583217 (3.09s) 0x30 0
128586843 (3.09s) 0x31 1
128590470 (3.09s) 0x33 3
128594097 (3.09s) 0x29 )
128597723 (3.09s) 0x0D
128601350 (3.09s) 0x0A
128604977 (3.09s) 0x62 b
128608603 (3.09s) 0x6F o
128612230 (3.09s) 0x67 g
128615857 (3.09s) 0x6F o
128619483 (3.09s) 0x6D m
128623110 (3.09s) 0x69 i
128626737 (3.09s) 0x70 p
128630363 (3.09s) 0x73 s
128633990 (3.09s) 0x09
128637617 (3.09s) 0x3A :
128641243 (3.09s) 0x20
128644870 (3.09s) 0x32 2
128648497 (3.09s) 0x32 2
128652123 (3.09s) 0x31 1
128655750 (3.09s) 0x2E .
128659377 (3.09s) 0x31 1
128663003 (3.09s) 0x38 8
128666630 (3.09s) 0x0D
128670257 (3.09s) 0x0A
128673883 (3.09s) 0x23 #
128677510 (3.09s) 0x20
131924144 (3.17s) end of decoding
- 基于 MiniLA 的移植与实现 (3)
- 基于 MiniLA 的移植与实现 (1)
- 基于 MiniLA 的移植与实现 (2)
- 基于ARM的Linux系统移植研究与实现
- 转自EDN基于ARM的Linux系统移植研究与实现
- 基于ARM11的嵌入式linux系统移植与实现--(笔记一)
- 基于ARM11的嵌入式linux系统移植与实现--笔记二
- 基于ARM11的嵌入式linux系统移植与实现--笔记三
- 基于ARM11的嵌入式linux系统移植与实现--笔记四
- 基于ARM的嵌入式linux 内核的裁剪与移植
- 基于嵌入式Linux 系统的MiniGUI 的移植与应用
- 基于s3c2410的tslib1.4的编译与移植~
- 基于Qtopia_Core的嵌入式Linux_GUI平台移植与开发 (转)
- 基于Tiny6410的LCD与一线触屏移植
- [转载]基于ARM的linux内核裁剪与移植
- 基于Android平台的x264的移植与应用(一):移植篇
- 基于Android平台的x264的移植与应用(一):移植篇
- 基于Android平台的x264的移植与应用(一):移植篇
- [转]为22-29岁的人解释一下什么叫工作
- SQL Server 2005&2008备份恢复总结
- 基于 MiniLA 的移植与实现 (1)
- c++宏展开的问题
- 基于 MiniLA 的移植与实现 (2)
- 基于 MiniLA 的移植与实现 (3)
- C#写XML的简单例子
- 【转载】 -- 15条使人醒悟的生活中的定律
- taskSpawn
- 迎世博中兴3G志愿者
- 发现程序员来不及做啊。
- 博客选型与 WordPress 改进
- pku1376Robot
- 硬件中断的总结