0.png (758.08 KB, 下載次數: 138)
下載附件
2016-6-16 22:20 上傳
0.png (900.23 KB, 下載次數: 164)
下載附件
2016-6-16 22:21 上傳
0.png (52.47 KB, 下載次數: 167)
下載附件
2016-6-16 22:20 上傳
0.png (56.88 KB, 下載次數: 155)
下載附件
2016-6-16 22:20 上傳
0.png (59.28 KB, 下載次數: 159)
下載附件
2016-6-16 22:20 上傳
0.png (59.02 KB, 下載次數: 146)
下載附件
2016-6-16 22:20 上傳
下位機原理圖
0.png (117.3 KB, 下載次數: 163)
下載附件
2016-6-16 22:22 上傳
部分程序:
- /*
- * Copyright (c) 2010 儀星電子
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
- /*
- * 著作權所有(C) 2010 儀星電子
- *
- * 本程序為自由軟件;您可依據自由軟件基金會所發表的GNU通用公共授權條款規定,
- * 就本程序再為發布與/或修改;無論您依據的是本授權的第二版或(您自行選擇的)
- * 任一日后發行的版本。
- * 本程序是基于使用目的而加以發布,然而不負任何擔保責任;亦無對適售性或特定
- * 目的適用性所為的默示性擔保。詳情請參照GNU通用公共授權。
- * 您應已收到附隨于本程序的GNU通用公共授權的副本;如果沒有,請寫信至自由軟件
- * 基金會:59 Temple Place - Suite 330, Boston, Ma 02111-1307, USA。
- * Email yixingdianzi@126.com
- * Email/MSN yixingdianzi@hotmail.com
- * QQ 648887464
- */
- /******************** (C) COPYRIGHT 2009 STMicroelectronics ********************
- * File Name : main.c
- * Author : MCD Application Team
- * Version : V3.1.0
- * Date : 10/30/2009
- * Description : Virtual Com Port Demo main file
- ********************************************************************************
- * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
- * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
- * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
- * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
- * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
- * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
- *******************************************************************************/
- /* Includes ------------------------------------------------------------------*/
- //#include "stm32f10x.h"
- #include "stm32f10x_gpio.h"
- #include "usb_lib.h"
- #include "usb_desc.h"
- #include "usb_pwr.h"
- #include "qdmx_usb.h"
- #include "qdmx_adc.h"
- #define SEND 32
- /* Private typedef -----------------------------------------------------------*/
- /* Private define ------------------------------------------------------------*/
- /* Private macro -------------------------------------------------------------*/
- /* Private variables ---------------------------------------------------------*/
- /* Extern variables ----------------------------------------------------------*/
- extern __IO uint32_t count_in;
- extern uint8_t Controla_a;
- extern uint8_t Controla_b;
- /* Private function prototypes -----------------------------------------------*/
- /* Private functions ---------------------------------------------------------*/
- void Set_System(void);
- void Callback(uint8_t *p);
- void Delay(__IO uint32_t nCount);
- void GPIO_configure(void);
- /*******************************************************************************
- * Function Name : main.
- * Description : Main routine.
- * Input : None.
- * Output : None.
- * Return : None.
- *******************************************************************************/
- int main(void)
- {
- vu8 s;
- /*設置系統時鐘*/
- Set_System();
-
- /*初始化USB模塊*/
- Set_USBClock();
- USB_Interrupts_Config();
- USB_Init();
- /*初始化AD模塊*/
- m_adc_clk_config();
- m_adc_gpio_config();
- m_adc_Interrupts_Config();
- m_adc_init();
- /*初始化GPIO引腳作為放大控制引腳*/
- GPIO_configure();
-
- count_in=0;
- /*默認初始值為放大1倍*/
- GPIO_ResetBits(GPIOA,GPIO_Pin_0);
- GPIO_ResetBits(GPIOA,GPIO_Pin_1);
- GPIO_ResetBits(GPIOA,GPIO_Pin_2);
- GPIO_ResetBits(GPIOB,GPIO_Pin_12);
- GPIO_ResetBits(GPIOB,GPIO_Pin_13);
- GPIO_ResetBits(GPIOB,GPIO_Pin_14);
- while (1)
- {
- }
- }
- void GPIO_configure(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure;
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE);
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB , ENABLE);
-
- RCC_AHBPeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE);
- RCC_AHBPeriphClockCmd(RCC_APB2Periph_GPIOB , ENABLE);
-
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_Init(GPIOB, &GPIO_InitStructure);
-
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_Init(GPIOA, &GPIO_InitStructure);
- }
- void Delay(__IO uint32_t nCount)
- {
- for(; nCount != 0; nCount--);
- }
- void Callback(uint8_t *p)
- {
- if (GetENDPOINT(ENDP1) & EP_DTOG_RX)
- {
- FreeUserBuffer(ENDP1, EP_DBUF_IN);
- UserToPMABufferCopy((uint8_t*) p, ENDP1_TX1ADDR, SEND);
- SetEPDblBuf1Count(ENDP1,EP_DBUF_IN,SEND);
- }
- else
- {
- FreeUserBuffer(ENDP1, EP_DBUF_IN);
- UserToPMABufferCopy((uint8_t*) p, ENDP1_TX0ADDR, SEND);
- SetEPDblBuf0Count(ENDP1,EP_DBUF_IN,SEND);
- }
- }
- #ifdef USE_FULL_ASSERT
- /*******************************************************************************
- * Function Name : assert_failed
- * Description : Reports the name of the source file and the source line number
- * where the assert_param error has occurred.
- * Input : - file: pointer to the source file name
- * - line: assert_param error line source number
- * Output : None
- * Return : None
- *******************************************************************************/
- void assert_failed(uint8_t* file, uint32_t line)
- {
- /* User can add his own implementation to report the file name and line number,
- ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
- /* Infinite loop */
- while (1)
- {}
- }
- #endif
- /*******************************************************************************
- * Function Name : Set_System
- * Description : Configures Main system clocks & power
- * Input : None.
- * Return : None.
- *******************************************************************************/
- void Set_System(void)
- {
- ErrorStatus HSEStartUpStatus;
- /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration -----------------------------*/
- /* RCC system reset(for debug purpose) */
- RCC_DeInit();
- /* Enable HSE */
- RCC_HSEConfig(RCC_HSE_ON);
- /* Wait till HSE is ready */
- HSEStartUpStatus = RCC_WaitForHSEStartUp();
- if (HSEStartUpStatus == SUCCESS)
- {
- /* Enable Prefetch Buffer */
- FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
- /* Flash 2 wait state */
- FLASH_SetLatency(FLASH_Latency_2);
-
- /* HCLK = SYSCLK */
- RCC_HCLKConfig(RCC_SYSCLK_Div1);
-
- /* PCLK2 = HCLK */
- RCC_PCLK2Config(RCC_HCLK_Div1);
- /* PCLK1 = HCLK/2 */
- RCC_PCLK1Config(RCC_HCLK_Div2);
- #ifdef STM32F10X_CL
- /* Configure PLLs *********************************************************/
- /* PLL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz */
- RCC_PREDIV2Config(RCC_PREDIV2_Div5);
- RCC_PLL2Config(RCC_PLL2Mul_8);
- /* Enable PLL2 */
- RCC_PLL2Cmd(ENABLE);
- /* Wait till PLL2 is ready */
- while (RCC_GetFlagStatus(RCC_FLAG_PLL2RDY) == RESET)
- {}
- /* PLL configuration: PLLCLK = (PLL2 / 5) * 9 = 72 MHz */
- RCC_PREDIV1Config(RCC_PREDIV1_Source_PLL2, RCC_PREDIV1_Div5);
- RCC_PLLConfig(RCC_PLLSource_PREDIV1, RCC_PLLMul_9);
- #else
- /* PLLCLK = 8MHz * 9 = 72 MHz */
- RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
- #endif
- /* Enable PLL */
- RCC_PLLCmd(ENABLE);
- /* Wait till PLL is ready */
- while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
- {
- }
- /* Select PLL as system clock source */
- RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
- /* Wait till PLL is used as system clock source */
- while(RCC_GetSYSCLKSource() != 0x08)
- {
- }
- }
- else
- { /* If HSE fails to start-up, the application will have wrong clock configuration.
- User can add here some code to deal with this error */
- /* Go to infinite loop */
- while (1)
- {
- }
- }
- }
- /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
復制代碼
元件清單:
Comment | Description | Designator | Quantity |
| Comment |
|
| 1 |
| 104 | Capacitor | C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C14, C16, C20, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39, C40, C41, C42, C45, C46, C48 | 34 | *** | 20pF | Capacitor | C12, C13 | 2 | *** | 10uF | Polarized Capacitor (Radial) | C19, C21, C22, C23 | 4 | *** | 47pF | Capacitor | C43, C44 | 2 | *** | LED | 發光二極管 | D1 | 1 | *** | 1N4148 | Diode | D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 | 10 | *** | DC-DC | -5V DC 模塊 | DC-DC | 1 | *** | 探頭 | 信號輸入接口探頭 | IN1, IN2 | 2 | *** | JTAG | STM32芯片JTAG調試接口 | J1 | 1 | *** | 100uH | Inductor | L1, L3, L5 | 3 | *** | 電源入口 | 電源接頭 | P1 | 1 | *** | 10K | Resistor | R1, R2, R3, R4, R5, R6, R7, R8, R12, R15, R17, R18 | 12 | *** | 330 | Resistor | R9 | 1 | *** | 22 | Resistor | R10, R13 | 2 | *** | 2.2K | Resistor | R11 | 1 | *** | 3.3K | Resistor | R14 | 1 | *** | 1K5 | Resistor | R16 | 1 | *** | 0 | Resistor | R19, R21 | 2 | *** | 1k | Resistor | R20, R24, R27, R28, R36, R37, R38, R40, R41 | 9 | *** | 560K | Resistor | R23, R42 | 2 | *** | 100k | Resistor | R25, R35, R39, R50 | 4 | *** | 240K | Resistor | R26, R44 | 2 | *** | 200K | Resistor | R29, R34, R47, R49 | 4 | *** | 2M | Resistor | R30, R43 | 2 | *** | 5M | Resistor | R31, R45 | 2 | *** | 1M | Resistor | R32, R46 | 2 | *** | 500k | Resistor | R33, R48 | 2 | *** | 39 | Resistor | R51, R52 | 2 | *** | 按鍵 | 按鍵 | RST1 | 1 | *** | STM32F103C8/STM32F103CB | STM32F103系列處理器 | U1 | 1 | *** | TL431 | 基準芯片 | U2 | 1 | *** | 7805 | 5V電源芯片 | U3 | 1 | *** | 1117-3.3 | 3.3V電源芯片 | U4 | 1 | *** | TL082 | 常用運放 | U5, U6, U7 | 3 | *** | CD4051BC | 8-Channel Analog Multiplexer | U8, U10 | 2 | *** | TL084 | 常用運放 | U9 | 1 | *** | USB_B口 | USB-B口 | USB1 | 1 | *** | 8MHz | 無源晶振 | X1 | 1 | *** |
0.png (82.05 KB, 下載次數: 142)
下載附件
2016-6-16 22:23 上傳
[贈品]虛擬示波器開源板(綠油) 全套資料下載_PDF_C5075.7z
(9.07 MB, 下載次數: 455)
2016-6-16 21:33 上傳
點擊文件名下載附件
123 下載積分: 黑幣 -5
|