飞思卡尔智能车舵机调试工具

上传者: qvsx100 | 上传时间: 2019-12-21 20:58:41 | 文件大小: 273KB | 文件类型: rar
程序名称: 飞思卡尔智能车舵机调试工具 v1.1 程序作者: LinX 时 间: 2009-03-07 联系方式: Q Q : 408111919 Email: linhaiwz@163.com" & vbCrLf & vbCrLf & _ 〖 本程序为方便舵机调试而编写,错误在所难免,如有建议欢迎和我联系! 〗 角度转换为高电平时间 角度 -45 0 45 (anger/度) 高电平时间 1000 1500 2000 (t/us) 计算公式为:T = 1000 + (anger + 45) * (1000 / 90) 该程序可以通过串口与单片机进行通讯,实时改变舵机的角度。 通讯协议为:0xfe 0xMM 0xNN (其中0xfe为包头,0xMM为PWMDTYx高8位,0xN为PWMDTYx低8位) 在串口中断中分三次接收,在第二次接收时保存数据到temp0中,在第三次接收到数据时将PWMDTY01= ((unsigned int)temp0 <<8) | RxData 就可以完成PWM改变输出了。 下位机程序如下: #include /* common defines and macros */ #include /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12xs128" unsigned char RX=0,temp0; void uart_putchar(unsigned char ch) { if (ch == '\n') { while(!(SCI0SR1&0x80)) ; SCI0DRL= 0x0d; return; } while(!(SCI0SR1&0x80)) ; SCI0DRL=ch; } static void PWM_Init(void) { //SB,B for ch2367 //SA,A for ch0145 PWMCTL_CON01=1; //0和1联合成16位PWM; PWMCAE_CAE1=0; //选择输出模式为左对齐输出模式 PWMCNT01 = 0; //计数器清零; PWMPOL_PPOL1=1; //先输出高电平,计数到DTY时,反转电平 PWMPRCLK = 0X40; //clockA不分频,clockA=busclock=16MHz;CLK B 16分频:1Mhz PWMSCLA = 8; //对clock SA 进行2*8=16分频;pwm clock=clockA/16=1MHz; PWMCLK_PCLK1 = 1; //选择clock SA做时钟源 PWMPER01 = 20000; //周期20ms; 50Hz;(可以使用的范围:50-200hz) PWMDTY01 = 1500; //高电平时间为1.5ms; PWME_PWME1 = 1; } void setbusclock(void) //PLL setting { CLKSEL=0X00; //disengage PLL to system PLLCTL_PLLON=1; //turn on PLL SYNR=1; REFDV=1; //pllclock=2*osc*(1+SYNR)/(1+REFDV)=32MHz; _asm(nop); //BUS CLOCK=16M _asm(nop); while(!(CRGFLG_LOCK==1)); //when pll is steady ,then use it; CLKSEL_PLLSEL =1; //engage PLL to system; } static void SCI_Init(void) //SCI { SCI0CR1=0x00; SCI0CR2=0x2c; //enable Receive Full Interrupt,RX enab

文件下载

资源详情

[{"title":"( 40 个子文件 273KB ) 飞思卡尔智能车舵机调试工具","children":[{"title":"舵机调试工具","children":[{"title":"说明.txt <span style='color:#111;'> 3.25KB </span>","children":null,"spread":false},{"title":"舵机调试工具","children":[{"title":"MSCOMM32.OCX <span style='color:#111;'> 101.31KB </span>","children":null,"spread":false},{"title":"舵机调试工具.exe <span style='color:#111;'> 44.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"测试程序","children":[{"title":"TBDML.ini <span style='color:#111;'> 2.94KB </span>","children":null,"spread":false},{"title":"Sources","children":[{"title":"datapage.c <span style='color:#111;'> 66.84KB </span>","children":null,"spread":false},{"title":"main.c <span style='color:#111;'> 4.18KB </span>","children":null,"spread":false},{"title":"Start12.c <span style='color:#111;'> 22.07KB </span>","children":null,"spread":false}],"spread":true},{"title":"bin","children":[{"title":"TBDML.abs <span style='color:#111;'> 143.81KB </span>","children":null,"spread":false},{"title":"TBDML.abs.glo <span style='color:#111;'> 1.10KB </span>","children":null,"spread":false},{"title":"Full_Chip_Simulation.map <span style='color:#111;'> 105B </span>","children":null,"spread":false},{"title":"TBDML.abs.s19 <span style='color:#111;'> 1.07KB </span>","children":null,"spread":false},{"title":"TBDML.map <span style='color:#111;'> 98.35KB </span>","children":null,"spread":false}],"spread":true},{"title":"Default.mem <span style='color:#111;'> 161B </span>","children":null,"spread":false},{"title":"test1.mcp <span style='color:#111;'> 107.71KB </span>","children":null,"spread":false},{"title":"tips.txt <span style='color:#111;'> 10.89KB </span>","children":null,"spread":false},{"title":"prm","children":[{"title":"burner.bbl <span style='color:#111;'> 9.90KB </span>","children":null,"spread":false},{"title":"TBDML_linker.prm <span style='color:#111;'> 4.86KB </span>","children":null,"spread":false},{"title":"Full_Chip_Simulation_linker.prm <span style='color:#111;'> 4.86KB </span>","children":null,"spread":false}],"spread":true},{"title":"C_Layout.hwl <span style='color:#111;'> 855B </span>","children":null,"spread":false},{"title":"test1_Data","children":[{"title":"TBDML","children":[{"title":"TargetDataWindows.tdt <span style='color:#111;'> 479.71KB </span>","children":null,"spread":false},{"title":"ObjectCode","children":[{"title":"MC9S12XS128.c.o <span style='color:#111;'> 133.13KB </span>","children":null,"spread":false},{"title":"Start12.c.o <span style='color:#111;'> 5.09KB </span>","children":null,"spread":false},{"title":"datapage.c.o <span style='color:#111;'> 13.66KB </span>","children":null,"spread":false},{"title":"main.c.o <span style='color:#111;'> 19.02KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"CWSettingsWindows.stg <span style='color:#111;'> 4.33KB </span>","children":null,"spread":false},{"title":"Full_Chip_Simulation","children":[{"title":"TargetDataWindows.tdt <span style='color:#111;'> 60.92KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"Full_Chip_Simulation.ini <span style='color:#111;'> 874B </span>","children":null,"spread":false},{"title":"readme.txt <span style='color:#111;'> 3.04KB </span>","children":null,"spread":false},{"title":"cmd","children":[{"title":"TBDML_Erase_unsecure_hcs12xe.cmd <span style='color:#111;'> 1.48KB </span>","children":null,"spread":false},{"title":"TBDML_Startup.cmd <span style='color:#111;'> 59B </span>","children":null,"spread":false},{"title":"Full_Chip_Simulation_Postload.cmd <span style='color:#111;'> 59B </span>","children":null,"spread":false},{"title":"TBDML_Postload.cmd <span style='color:#111;'> 59B </span>","children":null,"spread":false},{"title":"TBDML_Vppoff.cmd <span style='color:#111;'> 77B </span>","children":null,"spread":false},{"title":"TBDML_Reset.cmd <span style='color:#111;'> 60B </span>","children":null,"spread":false},{"title":"TBDML_Preload.cmd <span style='color:#111;'> 60B </span>","children":null,"spread":false},{"title":"Full_Chip_Simulation_Reset.cmd <span style='color:#111;'> 60B </span>","children":null,"spread":false},{"title":"Full_Chip_Simulation_Startup.cmd <span style='color:#111;'> 59B </span>","children":null,"spread":false},{"title":"Full_Chip_Simulation_Preload.cmd <span style='color:#111;'> 60B </span>","children":null,"spread":false},{"title":"TBDML_Vppon.cmd <span style='color:#111;'> 78B </span>","children":null,"spread":false},{"title":"Full_Chip_Simulation_SetCPU.cmd <span style='color:#111;'> 59B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true}]

评论信息

  • lz995218010 :
    下载了,很不错的,有帮助
    2013-08-16
  • DreamtechShen :
    东西还不错,但是要自己修改才能适应自己调试所要的要求
    2012-12-08
  • zcc0411 :
    有一些帮助,改了一些,还好
    2012-07-17

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明