- 博客(0)
- 资源 (7)
- 收藏
- 关注
2.STM32多路舵机控制程序.rar
#define POSA 0
#define POSB 500
#define POSC 1000
#define POSD 1500
#define POSE 2000
#define POSF 2500
#define POSG 0
/**********************************************************************************/
/*****************************Ö÷º¯Êý***********************************************/
int main(void)
{
Timer_Init(); //¶¨Ê±Æ÷³õʼ»¯
SysTick_Init(); //ϵͳµÎ´ð¶¨Ê±Æ÷³õʼ»¯
GPIO_Config(); //GPIO³õʼ»¯
USART1_Config(); //³õʼ»¯´®¿Ú1
USART3_Config(); //³õʼ»¯´®¿Ú3
Timer_ON(); //¿ªÆô¶¨Ê±Æ÷
while (1)
{
/*CPWM[0]=POSA;CPWM[1]=POSA;CPWM[2]=POSA;CPWM[3]=POSA;CPWM[4]=POSA;CPWM[5]=POSA;
CPWM[6]=POSA;CPWM[7]=POSA;CPWM[8]=POSA;CPWM[9]=POSA;CPWM[10]=POSA;CPWM[11]=POSA;
CPWM[12]=POSA;CPWM[13]=POSA;CPWM[14]=POSA;CPWM[15]=POSA;CPWM[16]=POSA;CPWM[17]=POSA;
CPWM[18]=POSA;CPWM[19]=POSA;CPWM[20]=POSA;CPWM[21]=POSA;CPWM[22]=POSA;CPWM[23]=POSA;
Delay_ms(1000);*/
CPWM[0] =POSB;CPWM[1] =POSB;CPWM[2] =POSB;CPWM[3] =POSB;CPWM[4] =POSB;CPWM[5] =POSB;
CPWM[6] =POSB;CPWM[7] =POSB;CPWM[8] =POSB;CPWM[9] =POSB;CPWM[10]=POSB;CPWM[11]=POSB;
CPWM[12]=POSB;CPWM[13]=POSB;CPWM[14]=POSB;CPWM[15]=POSB;CPWM[16]=POSB;CPWM[17]=POSB;
CPWM[18]=POSB;CPWM[19]=POSB;CPWM[20]=POSB;CPWM[21]=POSB;CPWM[22]=POSB;CPWM[23]=POSB;
Delay_ms(1000);
CPWM[0]=1500;CPWM[1]=1500;CPWM[2]=1500;CPWM[3]=1500;CPWM[4]=1500;CPWM[5]=1500;
CPWM[6]=1500;CPWM[7]=1500;CPWM[8]=1500;CPWM[9]=1500;CPWM[10]=1500;CPWM[11]=1500;
CPWM[12]=1500;CPWM[13]=1500;CPWM[14]=1500;CPWM[15]=1500;CPWM[16]=1500;CPWM[17]=1500;
CPWM[18]=1500;CPWM[19]=1500;CPWM[20]=1500;CPWM[21]=1500;CPWM[22]=1500;CPWM[23]=1500;
Delay_ms(1000);
CPWM[0]=2300;CPWM[1]=2300;CPWM[2]=2300;CPWM[3]=2300;CPWM[4]=2300;CPWM[5]=2300;
CPWM[6]=2300;CPWM[7]=2300;CPWM[8]=2300;CPWM[9]=2300;CPWM[10]=2300;CPWM[11]=2300;
CPWM[12]=2300;CPWM[13]=2300;CPWM[14]=2300;CPWM[15]=2300;CPWM[16]=2300;CPWM[17]=2300;
CPWM[18]=2300;CP
2019-12-02
C8051F320_USB_Bulk
--------------------------------------------------
USB Bulk Example Readme File
Copyright (C) 2005 Silicon Laboratories, Inc.
--------------------------------------------------
This release contains the following components:
* USB Bulk Driver Example
* USB Bulk Firmware Example
* Host Application (F32x_BulkFileTransfer.exe)
* Host Application Source
Last updated: 25 MAY 2005
Running the Example on the C8051F32x target board
------------------------------------------------------------
1) Connect the hardware:
a) Connect the target board to a PC through a Debug Adapter.
b) Install shorting blocks at the following positions:
J3[1-2] (P2.0 Switch), J3[3-4] (P2.1 Switch),
J3[5-6] (P2.2 LED), J3[7-8] (P2.3 LED), J9 (P0.2), J10 (P0.3)
and J13 (P1.7 Potentiometer).
c) Connect a USB cable between the target device and the host PC.
d) To power the target board from an wall-powered source, place a
shorting block at J2 and NO shorting block at J11. Next, connect
a DC power adapter to the target board at P1.
e) To power the target board from the USB bus, place a shorting block
on the target board at J11 and NO shorting block on J2.
2) Build and download the Bulk Example firmware:
a) Open the Silicon Laboratories IDE (v1.72 or later).
b) Open the Connection Options window by selecting Options->
Connection Options... in the IDE menus. In the Debug Interface
section, select C2.
c) Connect to the target C8051F32x device (Alt+C, or IDE menu
Debug->Connect).
d) From the Project menu, select "Open Project" and browse to the
Bulk Example Firware project "BulkFirmware.wsp", located by default in the
"Silabs\MCU\Examples\C8051F32x\USB_Bulk\Firmware" directory.
e) Build the project (F7, or through IDE menu Project->Build/Make Project).
f) Download the firmware (Alt+D).
3) Run the Bulk Example firmware:
a) In the IDE, Run the firmware (F5, or IDE menu Debug->Go).
b) When Windows detects the device and the driver installation wizard opens:
a. Choose "Search for a suitable driver for my device", and click Next.
b. Check the box "Specify a location", and click Next.
c. Browse to directory ..\USB_Bulk and select the file SilabsBulk.inf, and click OK.
d. Follow the dialogue to finish driver installation.
c) Once the firmware has been downloaded and is running, the IDE is no
longer needed. Disconnect from the target device with the IDE and
press the Reset button on the Target Board.
4) Run the Bulk Example host application:
a) Run the F32x_BulkFileTransfer.exe application located by default in the
"Silabs\MCU\Examples\C8051F32x\USB_Bulk" directory.
b) The F32x_BulkFileTransfer application will display the current USB
devices connected to the PC. Select the device to be used for the
file transfer.
c) Select file names for Transferring or Receiving data.
2011-09-22
LM3S9B92-USBHOSTMOUSE-编译时要用的一个USBLib,Driverlib
LM3S9B92-USBHOSTMOUSE-编译时要用的一个USBLib,Driverlib
2011-07-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人