历史上的今天
返回首页

历史上的今天

今天是:2025年03月29日(星期六)

2019年03月29日 | STM8L15x for IAR点亮LED

2019-03-29 来源:eefocus

一、电路分析


 STM8L151G6U6  的LED有两个,分别是 :LED1:POWER_LED  ----  PB1  ;


LED2:STATUS_LED  ----  PB2


二、IAR新建工程准备


1.在项目文件夹里创建3个文件夹


2.fWLIB用来存放stm8板子的各种配置头文件和.c文件


3.project用来存放工程文件和debug日志


三、新建工程


1.Create New Project


.

2.选择工程模板------c,将工程命名为led,将工程文件保存在project下


3.addd flies


四、配置选项卡


1.右键选项


2.GO --->target


3.GO----->library C

4..GO----->library O


5.C/C++---->Optimitions  代码的优化


 

6.C/C++---->preprocessor


$PROJ_DIR$     表示用户建项目的当前目录,途中显示的有stm8115x_conf头文件在项目中会使用,如果不把用户文件夹包含进来会报错                         显示找不到stm8115x_conf.h头文件。

$PROJ_DIR$..Fwliblibraryinc

$PROJ_DIR$..user

$PROJ_DIR$..FWlibinc

$PROJ_DIR$..FWliblibrarysrc


7.Output converter      设置输出的可执行文件的形式,通常有hex和bin两种形式:

8.设置下载工具的类型,STM8可以支持串口下载(比较麻烦!)和ST-LINK下载,我们用ST-LINK下载



五、代码的编写


1.main.c


#include "stm8_board.h"

#include "timing_delay.h"

 

int main( void )

{

  

turn_led(LED_STATUS, OFF);

 

}

2.led.c


 /****************************************

 *文件名  :led.c

 *描述    :GPIO口配置函数库   

 *实验平台:STM8L151g6开发板

 *作者    :LUOYIRAN    

 *QQ      :969303624

 *修改时间:2018.7.15

 *STM8L151g6开发板硬件连接

    |--------------------|

    |  LED1-power-PB1    |

    |  LED2-status-PB2   |

    |--------------------|

 *****************************************/

#include "led.h"

#include "stm8l15x_gpio.h"

 

 

void turn_led(uint8_t which, uint8_t cmd)

{

 

   if(OFF == cmd)   //如果发出关闭信号

 

        {

         if(which == LED_POWER)  //如果要关LED1

     GPIO_Init(SYSRUN_LED_PIN, GPIO_Mode_Out_PP_High_Slow);//初始化LED1

     else if(which == LED_STATUS) //如果要关LED2

       GPIO_Init(LED_STATUS_PIN, GPIO_Mode_Out_PP_High_Slow);//初始化LED2

          }

 

 

   else //如果发起开启信号

  {

     if(which == LED_POWER)    //如果要开LED1

       GPIO_Init(SYSRUN_LED_PIN, GPIO_Mode_Out_PP_Low_Slow); //初始化LED1

     else if(which == LED_STATUS)//如果要开LED2

       GPIO_Init(LED_STATUS_PIN, GPIO_Mode_Out_PP_Low_Slow);   //初始化LED2  

}

 

 

 }

LED.H


 

#ifndef __LED_H

#define __LED_H

 

#include "stm8_board.h"

#include "timing_delay.h"

#include "stm8l15x.h"

#include "stm8l15x_gpio.h"

 

 

                                                        

extern void turn_led(uint8_t which, uint8_t cmd);

 

#endif /*__LED_H*/

3.gpio.c/gpio.h(从库里拿)


#include "stm8l15x_gpio.h"

 

/** @addtogroup STM8L15x_StdPeriph_Driver

  * @{

  */

  

/** @addtogroup I2C

  * @{

  */

 

/* Exported types ------------------------------------------------------------*/

 

/** @addtogroup GPIO_Exported_Types

  * @{

  */

 

/**

  * @defgroup GPIO_Modes

  *

  * @brief

  *     

  * Bits definitions:

  * - Bit 7: 0 = INPUT mode

  *          1 = OUTPUT mode

  *          1 = PULL-UP (input) or PUSH-PULL (output)

  * - Bit 5: 0 = No external interrupt (input) or No slope control (output)

  *          1 = External interrupt (input) or Slow control enabled (output)

  * - Bit 4: 0 = Low level (output)

  *          1 = High level (output push-pull) or HI-Z (output open-drain)

  * @{

  */

 

 

/**

  * @}

  */

  

/** @defgroup GPIO_Pin

  * @{

  */

 

 

 

/**

  * @}

  */

  

/**

  * @}

  */

  

/* Exported constants --------------------------------------------------------*/

/* Exported macros -----------------------------------------------------------*/

 

/** @addtogroup GPIO_Exported_Macros

  * @{

  */

 

/**

  * @brief Macro used by the assert function to check the different functions parameters.

  */

 

/**

  * @brief Macro used by the assert function in order to check the different

  * values of GPIOMode_TypeDef.

  */

#define IS_GPIO_MODE(MODE)

  (((MODE) == GPIO_Mode_In_FL_No_IT)       ||

   ((MODE) == GPIO_Mode_In_PU_No_IT)       ||

   ((MODE) == GPIO_Mode_In_FL_IT)          ||

   ((MODE) == GPIO_Mode_In_PU_IT)          ||

   ((MODE) == GPIO_Mode_Out_OD_Low_Fast)   ||

   ((MODE) == GPIO_Mode_Out_PP_Low_Fast)   ||

   ((MODE) == GPIO_Mode_Out_OD_Low_Slow)   ||

   ((MODE) == GPIO_Mode_Out_PP_Low_Slow)   ||

   ((MODE) == GPIO_Mode_Out_OD_HiZ_Fast)   ||

   ((MODE) == GPIO_Mode_Out_PP_High_Fast)  ||

   ((MODE) == GPIO_Mode_Out_OD_HiZ_Slow)   ||

   ((MODE) == GPIO_Mode_Out_PP_High_Slow))

 

/**

  * @brief Macro used by the assert function in order to check the different

  * values of GPIO_Pins.

  */

#define IS_GPIO_PIN(PIN) ((PIN) != (uint8_t)0x00)

 

/**

  * @}

  */

 

 

/* Exported functions ------------------------------------------------------- */

/* Initialization and Configuration *******************************************/

void GPIO_DeInit(GPIO_TypeDef* GPIOx);

void GPIO_Init(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode);

void GPIO_ExternalPullUpConfig(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin, FunctionalState NewState);

 

/* GPIO Read and Write ********************************************************/

void GPIO_Write(GPIO_TypeDef* GPIOx, uint8_t GPIO_PortVal);

void GPIO_WriteBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, BitAction GPIO_BitVal);

void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin);

void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin);

void GPIO_ToggleBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin);

uint8_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx);

uint8_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx);

BitStatus GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin);

BitStatus GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin);

 

 

 

/**

  * @}

  */

  

/**

  * @}

  */

 

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

#include "stm8l15x_gpio.h"

 

/** @addtogroup STM8L15x_StdPeriph_Driver

  * @{

  */

 

/** @defgroup CLK 

  * @brief CLK driver modules

  * @{

  */ 

  

/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/

/* Private macro -------------------------------------------------------------*/

/* Private variables ---------------------------------------------------------*/

/* Private function prototypes -----------------------------------------------*/

/* Private functions ---------------------------------------------------------*/

 

/** @defgroup GPIO_Private_Functions

  * @{

  */ 

 

 

/** @defgroup GPIO_Group1 Initialization and Configuration

 *  @brief   Initialization and Configuration

 *

@verbatim   

 ===============================================================================

                        Initialization and Configuration

 ===============================================================================  

@endverbatim

  * @{

  */

 

/**

  * @brief  Deinitializes the GPIOx peripheral registers to their default reset values.

  * @param  GPIOx: Select the GPIO peripheral number (x = A to I).

  * @retval None

  */

void GPIO_DeInit(GPIO_TypeDef* GPIOx)

{

  GPIOx->CR2 = GPIO_CR2_RESET_VALUE; /* Reset Control Register 2 */

  GPIOx->ODR = GPIO_ODR_RESET_VALUE; /* Reset Output Data Register */

  GPIOx->DDR = GPIO_DDR_RESET_VALUE; /* Reset Data Direction Register */

  GPIOx->CR1 = GPIO_CR1_RESET_VALUE; /* Reset Control Register 1 */

}

 

/**

  * @brief  Initializes the GPIOx according to the specified parameters.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_Pin : This parameter contains the pin number

  *           This parameter can be one of the following values:

  *            @arg GPIO_Pin_0: Pin 0

  *            @arg GPIO_Pin_1: Pin 1

  *            @arg GPIO_Pin_2: Pin 2

  *            @arg GPIO_Pin_3: Pin 3

  *            @arg GPIO_Pin_4: Pin 4

  *            @arg GPIO_Pin_5: Pin 5

  *            @arg GPIO_Pin_6: Pin 6

  *            @arg GPIO_Pin_7: Pin 7              

  * @param  GPIO_Mode : This parameter can be a value of the

  *           This parameter can be one of the following values:

  *            @arg GPIO_Mode_In_FL_No_IT: Input floating, no external interrupt

  *            @arg GPIO_Mode_In_PU_No_IT: Input pull-up, no external interrupt

  *            @arg GPIO_Mode_In_FL_IT: Input pull-up, external interrupt

  *            @arg GPIO_Mode_Out_OD_Low_Fast: Output open-drain, low level, 10MHz

  *            @arg GPIO_Mode_Out_PP_Low_Fast: Output push-pull, low level, 10MHz

  *            @arg GPIO_Mode_Out_OD_Low_Slow: Output open-drain, low level, 2MHz

  *            @arg GPIO_Mode_Out_PP_Low_Slow: Output push-pull, low level, 2MHz

  *            @arg GPIO_Mode_Out_OD_HiZ_Fast: Output open-drain, high-impedance level, 10MHz

  *            @arg GPIO_Mode_Out_PP_High_Fast: Output push-pull, high level, 10MHz

  *            @arg GPIO_Mode_Out_OD_HiZ_Slow: Output open-drain, high-impedance level, 2MHz

  *            @arg GPIO_Mode_Out_PP_High_Slow: Output push-pull, high level, 2MHz

  * @retval None

  */

 

void GPIO_Init(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode)

{

  /*----------------------*/

  /* Check the parameters */

  /*----------------------*/

 

  assert_param(IS_GPIO_MODE(GPIO_Mode));

  assert_param(IS_GPIO_PIN(GPIO_Pin));

 

  /* Reset corresponding bit to GPIO_Pin in CR2 register */

  GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin));

 

  /*-----------------------------*/

  /* Input/Output mode selection */

  /*-----------------------------*/

 

  if ((((uint8_t)(GPIO_Mode)) & (uint8_t)0x80) != (uint8_t)0x00) /* Output mode */

  {

    if ((((uint8_t)(GPIO_Mode)) & (uint8_t)0x10) != (uint8_t)0x00) /* High level */

    {

      GPIOx->ODR |= GPIO_Pin;

    } else /* Low level */

    {

      GPIOx->ODR &= (uint8_t)(~(GPIO_Pin));

    }

    /* Set Output mode */

    GPIOx->DDR |= GPIO_Pin;

  } else /* Input mode */

  {

    /* Set Input mode */

    GPIOx->DDR &= (uint8_t)(~(GPIO_Pin));

  }

 

  /*------------------------------------------------------------------------*/

  /* Pull-Up/Float (Input) or Push-Pull/Open-Drain (Output) modes selection */

  /*------------------------------------------------------------------------*/

 

  if ((((uint8_t)(GPIO_Mode)) & (uint8_t)0x40) != (uint8_t)0x00) /* Pull-Up or Push-Pull */

  {

    GPIOx->CR1 |= GPIO_Pin;

  } else /* Float or Open-Drain */

  {

    GPIOx->CR1 &= (uint8_t)(~(GPIO_Pin));

  }

 

  /*-----------------------------------------------------*/

  /* Interrupt (Input) or Slope (Output) modes selection */

  /*-----------------------------------------------------*/

 

  if ((((uint8_t)(GPIO_Mode)) & (uint8_t)0x20) != (uint8_t)0x00) /* Interrupt or Slow slope */

  {

    GPIOx->CR2 |= GPIO_Pin;

  } else /* No external interrupt or No slope control */

  {

    GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin));

  }

 

}

 

/**

  * @brief  Configures the external pull-up on GPIOx pins.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_Pin : Specifies the pin number

  *           This parameter can be one of the following values:

  *            @arg GPIO_Pin_0: Pin 0

  *            @arg GPIO_Pin_1: Pin 1

  *            @arg GPIO_Pin_2: Pin 2

  *            @arg GPIO_Pin_3: Pin 3

  *            @arg GPIO_Pin_4: Pin 4

  *            @arg GPIO_Pin_5: Pin 5

  *            @arg GPIO_Pin_6: Pin 6

  *            @arg GPIO_Pin_7: Pin 7     

  * @param  NewState : The new state of the pull up pin.

  *           Can be ENABLE or DISABLE  

  * @retval None

  */

void GPIO_ExternalPullUpConfig(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin, FunctionalState NewState)

{

  /* Check the parameters */

  assert_param(IS_GPIO_PIN(GPIO_Pin));

  assert_param(IS_FUNCTIONAL_STATE(NewState));

 

  if (NewState != DISABLE) /* External Pull-Up Set*/

  {

    GPIOx->CR1 |= GPIO_Pin;

  } else /* External Pull-Up Reset*/

  {

    GPIOx->CR1 &= (uint8_t)(~(GPIO_Pin));

  }

}

 

/**

  * @}

  */

 

/** @defgroup GPIO_Group2 GPIO Read and Write

 *  @brief   GPIO Read and Write

 *

@verbatim   

 ===============================================================================

                              GPIO Read and Write

 ===============================================================================  

@endverbatim

  * @{

  */

 

/**

  * @brief  Writes data to the specified GPIO data port.

  * @note   The port must be configured in output mode.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_PortVal : Specifies the value to be written to the port output

  *         data register.

  * @retval None

  */

void GPIO_Write(GPIO_TypeDef* GPIOx, uint8_t GPIO_PortVal)

{

  GPIOx->ODR = GPIO_PortVal;

}

 

/**

  * @brief  Sets or clears the selected data port bit.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_Pin: Specifies the port bit to be written.

  *           This parameter can be one of the following values:

  *            @arg GPIO_Pin_0: Pin 0

  *            @arg GPIO_Pin_1: Pin 1

  *            @arg GPIO_Pin_2: Pin 2

  *            @arg GPIO_Pin_3: Pin 3

  *            @arg GPIO_Pin_4: Pin 4

  *            @arg GPIO_Pin_5: Pin 5

  *            @arg GPIO_Pin_6: Pin 6

  *            @arg GPIO_Pin_7: Pin 7   

  * @param  GPIO_BitVal: specifies the desired status to be written.

  *         This parameter can be SET or RESET

  * @retval None

  */

void GPIO_WriteBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, BitAction GPIO_BitVal)

{

  /* Check the parameters */

  assert_param(IS_GPIO_PIN(GPIO_Pin));

  assert_param(IS_STATE_VALUE(GPIO_BitVal));

 

  if (GPIO_BitVal != RESET)

  {

    GPIOx->ODR |= GPIO_Pin;

 

  }

  else

  {

    GPIOx->ODR &= (uint8_t)(~GPIO_Pin);

  }

}

 

/**

  * @brief  Writes high level to the specified GPIO pins.

  * @note   The port must be configured in output mode.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_Pin : Specifies the pins to be turned high.

  *           This parameter can be one of the following values:

  *            @arg GPIO_Pin_0: Pin 0

  *            @arg GPIO_Pin_1: Pin 1

  *            @arg GPIO_Pin_2: Pin 2

  *            @arg GPIO_Pin_3: Pin 3

  *            @arg GPIO_Pin_4: Pin 4

  *            @arg GPIO_Pin_5: Pin 5

  *            @arg GPIO_Pin_6: Pin 6

  *            @arg GPIO_Pin_7: Pin 7   

  * @retval None

  */

void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin)

{

  GPIOx->ODR |= GPIO_Pin;

}

 

/**

  * @brief  Writes low level to the specified GPIO pins.

  * @note   The port must be configured in output mode.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_Pin : Specifies the pins to be turned low

  *           This parameter can be one of the following values:

  *            @arg GPIO_Pin_0: Pin 0

  *            @arg GPIO_Pin_1: Pin 1

  *            @arg GPIO_Pin_2: Pin 2

  *            @arg GPIO_Pin_3: Pin 3

  *            @arg GPIO_Pin_4: Pin 4

  *            @arg GPIO_Pin_5: Pin 5

  *            @arg GPIO_Pin_6: Pin 6

  *            @arg GPIO_Pin_7: Pin 7 

  * @retval None

  */

void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin)

{

  GPIOx->ODR &= (uint8_t)(~GPIO_Pin);

}

 

/**

  * @brief  Toggles the specified GPIO pins.

  * @note   The port must be configured in output mode.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_Pin : Specifies the pins to be toggled.

  * @retval None

  */

void GPIO_ToggleBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin)

{

  GPIOx->ODR ^= GPIO_Pin;

}

 

/**

  * @brief  Reads the specified GPIO input data port.

  * @note   The port must be configured in input mode.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @retval The GPIOx input data port value.

  */

uint8_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx)

{

  return ((uint8_t)GPIOx->IDR);

}

 

/**

  * @brief  Reads the specified GPIO output data port.

  * @note   The port must be configured in input mode.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @retval The GPIOx  output data port value.

  */

uint8_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)

{

  return ((uint8_t)GPIOx->ODR);

}

 

/**

  * @brief  Reads the specified GPIO input data pin.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_Pin : Specifies the pin number.

  *           This parameter can be one of the following values:

  *            @arg GPIO_Pin_0: Pin 0

  *            @arg GPIO_Pin_1: Pin 1

  *            @arg GPIO_Pin_2: Pin 2

  *            @arg GPIO_Pin_3: Pin 3

  *            @arg GPIO_Pin_4: Pin 4

  *            @arg GPIO_Pin_5: Pin 5

  *            @arg GPIO_Pin_6: Pin 6

  *            @arg GPIO_Pin_7: Pin 7 

  * @retval BitStatus : GPIO input pin status.

  */

BitStatus GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin)

{

  return ((BitStatus)(GPIOx->IDR & (uint8_t)GPIO_Pin));

}

 

/**

  * @brief  Reads the specified GPIO Output data pin.

  * @param  GPIOx : Select the GPIO peripheral number (x = A to I).

  * @param  GPIO_Pin : Specifies the pin number

  * @retval BitStatus : GPIO output pin status.

  */

BitStatus GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin)

{

  return ((BitStatus)(GPIOx->ODR & (uint8_t)GPIO_Pin));

}

 

/**

  * @}

  */ 

 

/**

  * @}

  */ 

  

/**

  * @}

  */

 

/**

  * @}

  */

 

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

推荐阅读

史海拾趣

Headland Technology Product Group公司的发展小趣事

进入21世纪后,随着电子技术的飞速发展,HBControls意识到只有不断创新才能保持竞争力。公司加大了研发投入,成立了专门的研发团队,专注于新型继电器产品的研发。经过多次试验和改进,HBControls成功推出了HD-4850系列高性能继电器,该系列产品以其高可靠性、长寿命和低功耗等特点迅速赢得了市场的青睐。这一创新不仅提升了公司的市场份额,也进一步巩固了HBControls在继电器领域的领先地位。

Holt Integrated Circuits公司的发展小趣事

Holt在支持ARINC 429标准方面展现出了强大的实力。其ARINC 429 IC产品系列从简单的线路接收器到集成RAM的完整协议解决方案,覆盖了业内最广泛的范围。这些产品设计精巧,能够在单个3.3V电源上运行,显著降低了系统复杂性和板空间,为航空电子系统带来了更高的效率和可靠性。Holt的这一系列创新产品,不仅满足了航空制造商的严格需求,也推动了ARINC 429标准在全球范围内的广泛应用。

Caddock公司的发展小趣事

Caddock公司的发展可以追溯到1962年,当时公司推出了Micronox电阻系统。这一创新技术使电阻器在极端操作条件和恶劣环境下实现了高水平的稳定性和可靠性。这一重大突破为Caddock公司赢得了市场的广泛认可,并为后续的电阻材料技术发展奠定了坚实的基础。

American Micro Products Inc公司的发展小趣事

在环保和可持续发展成为全球共识的背景下,AMP积极响应号召,将绿色发展理念融入企业的日常运营中。公司采用环保材料和工艺,减少生产过程中的污染排放。同时,AMP还积极推动循环经济的发展,努力实现资源的有效利用和废弃物的减量化处理。

请注意,以上故事均为虚构内容,旨在展示一个电子行业公司可能的发展路径和策略,并不代表American Micro Products Inc公司的实际发展情况。如需了解该公司的真实故事和发展历程,建议查阅相关新闻报道、公司年报或行业研究报告等权威资料。

Gumstix公司的发展小趣事
检查电路连接是否松动或断裂,重新连接或更换损坏的部件。
Dytran Instruments Inc公司的发展小趣事

2022年5月,英国思百吉集团(Spectris)以5.4亿美元的价格收购了Dytran。这次收购是思百吉集团进一步扩大其在传感器领域的布局的重要举措。作为思百吉集团旗下的子公司,Dytran将继续保持其独立性和品牌特色,同时借助思百吉的全球资源和市场渠道,加速其业务发展和市场拓展。

在被收购后,Dytran与思百吉旗下的其他品牌进行了业务整合。通过共享研发资源、优化供应链、拓展销售渠道等方式,Dytran实现了与思百吉旗下品牌的协同发展。这不仅提高了公司的运营效率和市场竞争力,还为客户提供了更加全面和优质的服务。

问答坊 | AI 解惑

vb程序调试正常运行错误

本人刚学VB,在写一个串口数据采集大的小软件,刚开始就遇到了问题,以下代码,我在调试时都正常运行,能正确获得返回数据,可是生成exe文件后,程序却没反应,也没有错误信息出现!就是没有数据,求高手帮忙! Public gSend As Boolean  &nb ...…

查看全部问答>

音频驱动问题

马上要改个音频的linux下驱动,具体如下:以前用aic32现在要改成aic31。linux下驱动 请问:        芯片手册是英文的,有些东西看不大懂。音频芯片相关的文档,或音频方面的基础知识要去哪里找,或搜索什么关键词,我搜了 ...…

查看全部问答>

wince5.0中如何捕捉鼠标位置,实现全屏书写,实时显示书写的轨迹?

wince5.0中如何捕捉鼠标位置,实现全屏书写,实时显示书写的轨迹?在自己建立的窗口中已经可以书写,显示轨迹了。但是出来自己创建的窗口就没办法书写了。困恼了很久了,高手、专家指点啊。最好能给点实例代码参考 邮箱echenxi@163.com  …

查看全部问答>

请问

刚涉足这个领域,要配硬件环境,不知道哪个开发语言好呢.…

查看全部问答>

请教看懂原理图需要什么样的基础?

要看懂原理图需要哪些学科知识作为基础? 想学偏软件方面,C和汇编基础比较好,电路理论的基础比较差。 数电模电没学,能不能学嵌入式呢?…

查看全部问答>

关于LED驱动电源的谐波测试必备

杭州远方PF9811,才两千多块钱; 2-50次谐波都能测出来; 按IEC61000-3-2,谐波要测到39次…

查看全部问答>

ZigBee网络是否容许有的设备加密有的不加密

我现在在测试zigbee加密问题,协调器不使用加密,而路由器使用机密的时候,发现路由加入不了网络,不知到为什么。请哪位高手指教一下。 哦,我加密的时候只在f8Config.cfg上面把DSECURE设成1.…

查看全部问答>

请教关于市电220V检测电路

最近朋友让我给他弄一个市电检测电路,用在工业上的,要求在市电200V以上的时候输出一个脉冲,并且脉冲宽度在有限的时间内可调,各位大虾有没有做过类似电路的?望指点一二。以下是我个人设计的电路,在我个人的系统中测试的结果还算理想,经过几天 ...…

查看全部问答>

碰到一个g2553AD的有趣现象

有两个待测电压A,B, B的功率比A大;两块g2553; 现象:测电压A,用万用表可以测得出,一接到板子上用g2553A测就不行;换上g2553B就行了.程序是一样。           测电压B,用用万用表跟g2553A B都可以测得出。 ...…

查看全部问答>