vincer's profilevincer's moodPhotosBlogListsMore Tools Help

Blog


    January 08

    ccup小结

     

    本来早就应该写的。

     

     

    可行性:Mega128处理图像(主要是图像格式及大小转换)能否胜任的问题,是否要借助fpga/cpld加以实现?-_-# —> ^_^

     

    1. Gprs模块:TR800相关数据手册, 注意ATE0这个命令(让我郁闷了一阵),此后决定认真的重读数据手册。

     

    2. Xmodem通信协议(已写)。

     

    3. Spi总线:XF-S4240语音芯片的通信方式有I2C,SPI,UART,选用SPI

    设置如下:atmega128- SPI初始化时,将PORTBMOSISCLKSS引脚作为输出,同时将MISO作为输入引脚,并打开上拉电阻,设置主机模式,高位优先,数据速率f/ 16

    SPI的寄存器进行初始化设置时,应注意以下几点:
        .
    正确选择和设置主机或从机,以及工作模式(极性),数据传输率;

        .
    注意传送字节的顺序,是低位优先(LSB First)还是高位优先(MSB Frist);

        .
    正确设置MOSIMISO接口的输入输出方向,输入引脚使用上拉电阻。

     

    4. Usart:由于数据量比较大,误差累积将导致后面的数据出错,故用无误差的晶振频率(试过用16Mhz,但往往是只有前面的一小部分数据正确,往后的数据都出错,改用11.0592后没有发生过数据出错问题,出错就重传);中断+数据缓存区(FIFO),若直接对buffer操作,则注意先把index置零。

     

    5. 全彩Led屏通信协议:由于屏只有windows下的开发dll,肯定不能用在atmega128上了,屏提供的windows程序与Led屏的通信用serialport分析得到通信协议格式。

     

    6. 摄像头通信协议:使用的是zm460RS232接口,相当郁闷的是数据手册是有误的,只能设定被动模式,而且波特率不能改动,加上指令格式有些错误,庆幸的是有串口监控。

     

    7. 串口硬件设计:公、母串口要配备好,弄清串口线需要交叉还是直通,gprs模块要求硬件流控制信号(rts&cts),不用则将其屏蔽掉(7-8短接),否则不能通信。

     

    8. 红外探头:测试后,红外探头没有描述的灵敏,没办法,只能把红外检测程序考虑完善(就利用这个不灵敏的特点),经调试最后得到很好的稳定性。

     

    9. 图像转换:jpeg->xmp

     

    10. 硬件的布局及布线:

    布线要合理,不要跳线太多,做pcb布线的话还是好好的学习一下其相关理论。

    后期正式做板时,由于硬件布线不好,程序经常跑飞,那种心情叫无奈。

    提高硬件可靠性的考虑: 

    硬件-

    .大面积铺地(网格)

    .晶振用地围住;

    .每个ICVCC加上一个0.1uF的电容。

    .外围设备控制光耦隔离

    软件-
        .
    采用振荡电路的输出小幅度;

        .
    选择合适的启动延时参数
        .
    片内的看门狗
        .
    不用I/O口设定输出低电平

     

     

    由于没有JTAG仿真器,程序的调试都是用串口回传数据,在适当的地方设置把裸机上的数据回传同样起到仿真器的效果。

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://wzhvincer.spaces.live.com/blog/cns!32C0531362E6C4C0!210.trak
    Weblogs that reference this entry
    • None