欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 虛擬示波器制作資料 [打印本頁]

作者: 偉民電子    時間: 2016-6-16 21:35
標題: 虛擬示波器制作資料


下位機原理圖


部分程序:
  1. /*
  2. * Copyright (c) 2010 儀星電子
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.

  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. * GNU General Public License for more details.

  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  15. */

  16. /*
  17. * 著作權所有(C) 2010 儀星電子
  18. *
  19. * 本程序為自由軟件;您可依據自由軟件基金會所發表的GNU通用公共授權條款規定,
  20. * 就本程序再為發布與/或修改;無論您依據的是本授權的第二版或(您自行選擇的)
  21. * 任一日后發行的版本。

  22. * 本程序是基于使用目的而加以發布,然而不負任何擔保責任;亦無對適售性或特定
  23. * 目的適用性所為的默示性擔保。詳情請參照GNU通用公共授權。

  24. * 您應已收到附隨于本程序的GNU通用公共授權的副本;如果沒有,請寫信至自由軟件
  25. * 基金會:59 Temple Place - Suite 330, Boston, Ma 02111-1307, USA。

  26. * Email yixingdianzi@126.com
  27. * Email/MSN yixingdianzi@hotmail.com
  28. * QQ 648887464
  29. */

  30. /******************** (C) COPYRIGHT 2009 STMicroelectronics ********************
  31. * File Name          : main.c
  32. * Author             : MCD Application Team
  33. * Version            : V3.1.0
  34. * Date               : 10/30/2009
  35. * Description        : Virtual Com Port Demo main file
  36. ********************************************************************************
  37. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  38. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
  39. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  40. * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
  41. * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
  42. * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  43. *******************************************************************************/

  44. /* Includes ------------------------------------------------------------------*/
  45. //#include "stm32f10x.h"
  46. #include "stm32f10x_gpio.h"
  47. #include "usb_lib.h"
  48. #include "usb_desc.h"
  49. #include "usb_pwr.h"
  50. #include "qdmx_usb.h"
  51. #include "qdmx_adc.h"

  52. #define SEND 32

  53. /* Private typedef -----------------------------------------------------------*/
  54. /* Private define ------------------------------------------------------------*/
  55. /* Private macro -------------------------------------------------------------*/
  56. /* Private variables ---------------------------------------------------------*/
  57. /* Extern variables ----------------------------------------------------------*/
  58. extern __IO uint32_t count_in;
  59. extern uint8_t Controla_a;
  60. extern uint8_t Controla_b;

  61. /* Private function prototypes -----------------------------------------------*/
  62. /* Private functions ---------------------------------------------------------*/
  63. void Set_System(void);
  64. void Callback(uint8_t *p);
  65. void Delay(__IO uint32_t nCount);
  66. void GPIO_configure(void);                                       
  67. /*******************************************************************************
  68. * Function Name  : main.
  69. * Description    : Main routine.                                
  70. * Input          : None.
  71. * Output         : None.
  72. * Return         : None.
  73. *******************************************************************************/
  74. int main(void)
  75. {  
  76.         vu8 s;
  77.         /*設置系統時鐘*/
  78.         Set_System();
  79.         
  80.         /*初始化USB模塊*/  
  81.         Set_USBClock();
  82.         USB_Interrupts_Config();
  83.         USB_Init();
  84.         /*初始化AD模塊*/
  85.         m_adc_clk_config();
  86.           m_adc_gpio_config();
  87.           m_adc_Interrupts_Config();
  88.           m_adc_init();

  89.         /*初始化GPIO引腳作為放大控制引腳*/
  90.         GPIO_configure();
  91.                                           
  92.           count_in=0;
  93.         /*默認初始值為放大1倍*/

  94.         GPIO_ResetBits(GPIOA,GPIO_Pin_0);
  95.         GPIO_ResetBits(GPIOA,GPIO_Pin_1);
  96.         GPIO_ResetBits(GPIOA,GPIO_Pin_2);

  97.         GPIO_ResetBits(GPIOB,GPIO_Pin_12);
  98.         GPIO_ResetBits(GPIOB,GPIO_Pin_13);
  99.         GPIO_ResetBits(GPIOB,GPIO_Pin_14);

  100.           while (1)
  101.           {                 
  102.           }
  103. }

  104. void GPIO_configure(void)
  105. {
  106.         GPIO_InitTypeDef GPIO_InitStructure;

  107.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE);
  108.           RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB , ENABLE);
  109.         
  110.         RCC_AHBPeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE);
  111.         RCC_AHBPeriphClockCmd(RCC_APB2Periph_GPIOB , ENABLE);               

  112.           GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14;
  113.           GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  114.         GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  115.           GPIO_Init(GPIOB, &GPIO_InitStructure);

  116.         
  117.         GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2;
  118.           GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  119.           GPIO_Init(GPIOA, &GPIO_InitStructure);
  120. }

  121. void Delay(__IO uint32_t nCount)
  122. {
  123.   for(; nCount != 0; nCount--);
  124. }


  125. void Callback(uint8_t *p)
  126. {
  127.         if (GetENDPOINT(ENDP1) & EP_DTOG_RX)
  128.         {
  129.                    FreeUserBuffer(ENDP1, EP_DBUF_IN);
  130.                    UserToPMABufferCopy((uint8_t*) p, ENDP1_TX1ADDR, SEND);
  131.                    SetEPDblBuf1Count(ENDP1,EP_DBUF_IN,SEND);
  132.         }
  133.         else
  134.         {
  135.                    FreeUserBuffer(ENDP1, EP_DBUF_IN);
  136.                    UserToPMABufferCopy((uint8_t*) p, ENDP1_TX0ADDR, SEND);
  137.                    SetEPDblBuf0Count(ENDP1,EP_DBUF_IN,SEND);
  138.         }
  139. }

  140. #ifdef USE_FULL_ASSERT
  141. /*******************************************************************************
  142. * Function Name  : assert_failed
  143. * Description    : Reports the name of the source file and the source line number
  144. *                  where the assert_param error has occurred.
  145. * Input          : - file: pointer to the source file name
  146. *                  - line: assert_param error line source number
  147. * Output         : None
  148. * Return         : None
  149. *******************************************************************************/
  150. void assert_failed(uint8_t* file, uint32_t line)
  151. {
  152.   /* User can add his own implementation to report the file name and line number,
  153.      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  154.   /* Infinite loop */
  155.   while (1)
  156.   {}
  157. }
  158. #endif

  159. /*******************************************************************************
  160. * Function Name  : Set_System
  161. * Description    : Configures Main system clocks & power
  162. * Input          : None.
  163. * Return         : None.
  164. *******************************************************************************/
  165. void Set_System(void)
  166. {
  167.   ErrorStatus HSEStartUpStatus;
  168.   /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration -----------------------------*/   
  169.   /* RCC system reset(for debug purpose) */
  170.   RCC_DeInit();

  171.   /* Enable HSE */
  172.   RCC_HSEConfig(RCC_HSE_ON);

  173.   /* Wait till HSE is ready */
  174.   HSEStartUpStatus = RCC_WaitForHSEStartUp();

  175.   if (HSEStartUpStatus == SUCCESS)
  176.   {
  177.     /* Enable Prefetch Buffer */
  178.     FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);

  179.     /* Flash 2 wait state */
  180.     FLASH_SetLatency(FLASH_Latency_2);

  181.     /* HCLK = SYSCLK */
  182.     RCC_HCLKConfig(RCC_SYSCLK_Div1);
  183.   
  184.     /* PCLK2 = HCLK */
  185.     RCC_PCLK2Config(RCC_HCLK_Div1);

  186.     /* PCLK1 = HCLK/2 */
  187.     RCC_PCLK1Config(RCC_HCLK_Div2);

  188. #ifdef STM32F10X_CL
  189.     /* Configure PLLs *********************************************************/
  190.     /* PLL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz */
  191.     RCC_PREDIV2Config(RCC_PREDIV2_Div5);
  192.     RCC_PLL2Config(RCC_PLL2Mul_8);

  193.     /* Enable PLL2 */
  194.     RCC_PLL2Cmd(ENABLE);

  195.     /* Wait till PLL2 is ready */
  196.     while (RCC_GetFlagStatus(RCC_FLAG_PLL2RDY) == RESET)
  197.     {}

  198.     /* PLL configuration: PLLCLK = (PLL2 / 5) * 9 = 72 MHz */
  199.     RCC_PREDIV1Config(RCC_PREDIV1_Source_PLL2, RCC_PREDIV1_Div5);
  200.     RCC_PLLConfig(RCC_PLLSource_PREDIV1, RCC_PLLMul_9);
  201. #else
  202.     /* PLLCLK = 8MHz * 9 = 72 MHz */
  203.     RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
  204. #endif

  205.     /* Enable PLL */
  206.     RCC_PLLCmd(ENABLE);

  207.     /* Wait till PLL is ready */
  208.     while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
  209.     {
  210.     }

  211.     /* Select PLL as system clock source */
  212.     RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);

  213.     /* Wait till PLL is used as system clock source */
  214.     while(RCC_GetSYSCLKSource() != 0x08)
  215.     {
  216.     }
  217.   }
  218.   else
  219.   { /* If HSE fails to start-up, the application will have wrong clock configuration.
  220.        User can add here some code to deal with this error */   

  221.     /* Go to infinite loop */
  222.     while (1)
  223.     {
  224.     }
  225.   }
  226. }
  227. /******************* (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
***


[贈品]虛擬示波器開源板(綠油) 全套資料下載_PDF_C5075.7z (9.07 MB, 下載次數: 455)



作者: Lighty-Mi    時間: 2016-10-6 12:53
正需要呢  謝謝樓主  下來學習學習
作者: 邰夏留    時間: 2016-10-7 08:47
下載收藏下。好東西
作者: wpppmlah    時間: 2016-10-7 11:39
灰常不錯,灰常感謝!
作者: gaozhaohong    時間: 2016-10-7 12:02
謝謝樓主,謝謝樓主
作者: rain_2015_long    時間: 2016-10-8 10:36
做個記號,這個一點要頂
作者: gkseoqhd    時間: 2016-11-11 21:28
我就是想知道CD4501是怎么工作的
作者: cuihaodianzi    時間: 2016-12-22 14:44
這板子看著好眼熟,好像嘉立創買元器件會送板子。但……貌似板子上的好多元器件又會缺貨
作者: gl542400    時間: 2016-12-24 19:07
做個記號,這個一點要頂
作者: zhhufe    時間: 2017-1-17 22:14
正需要呢  謝謝樓主  下來學習學
作者: 作業本    時間: 2017-1-28 21:05
早就想做一個了開始整
作者: zezy371    時間: 2017-2-1 17:31
及時雨啊,正在尋找這個東西呢!
作者: jms209    時間: 2017-2-9 17:51

謝謝分享....
作者: qjzyx    時間: 2018-1-9 21:25
好資料!謝謝分享!
作者: nulijinbu    時間: 2018-2-22 13:01
很不錯,頂一下
作者: liuzx66    時間: 2018-2-25 14:14
扣了三次黑幣,也沒有下載成
作者: cjx96872    時間: 2018-4-12 14:27
謝謝樓主  學習學習
作者: tianyu22    時間: 2020-2-26 10:15
正好要做一個波形顯示的東西,看看他的上位機代碼可不可以用。。。希望是c#
作者: tianyu22    時間: 2020-2-26 10:19
呃,原來沒有上位機源碼。。。被控制了。。。
作者: wanjian16888    時間: 2020-3-16 21:43
學習了那么久的單片機,有幸一見,不錯。
作者: shiyb    時間: 2020-3-24 21:56
太崇拜了,收藏攢幣
作者: xiaohuang2020    時間: 2020-4-11 15:11
感謝樓主
作者: QDMLIT    時間: 2020-4-17 16:51
非常感謝
作者: xugh1977    時間: 2021-4-15 11:39
不錯,好東西,可以試著做一個!
作者: yygdzjs    時間: 2021-5-11 17:25
芯片 漲價. STM32Fxxx 難買 也貴,看能不能 用其它國內單片機代替.
有空制作一下.  謝謝老帖.
作者: 真的學不會51    時間: 2021-6-24 23:33
正好要用到,感謝樓主無私奉獻
作者: zheng_wei339    時間: 2021-11-14 13:59
我往單片機內下載了程序,PC驅動也正確安裝,但程序鏈接沒有反應
作者: 王言之    時間: 2021-11-19 15:07
下載不成功,不知道是不是個別原因!
作者: zydl123    時間: 2021-11-23 12:58
正需要呢 謝謝樓主 下來學習
作者: zydl123    時間: 2021-11-25 12:11
資料不錯,收下了,有成品買嗎
作者: aide51    時間: 2022-12-14 10:24
這個很不錯,可以做著玩啊玩
作者: 陽光璀璨    時間: 2023-4-14 20:40
這個很不錯,可以做著玩啊玩
作者: yuanbangmiao    時間: 2023-4-18 10:28
這個真不錯,好好學習一下
作者: zheng_wei339    時間: 2023-6-3 17:05
已經制作成功,可惜只能在XP系統使用
作者: lksbbs    時間: 2023-11-16 17:22
有成品么,項目太多,不想都折騰
作者: XDDZ1013    時間: 2024-1-5 18:16
下載收藏一下。




歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1