1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我尝试在''Example01_STM8S207_RC_5k'中修改TSL V.2.4.0中的代码,以便在STM8S103K3和STM8S105C6上运行。
测试STM8S发现(对于STM8S105C6)。 按照TSL文档修改代码但不起作用。 LED闪烁(项目基本代码可调节LED闪烁速度), 但触摸感觉发生了。 LED闪烁速度不变。 STM8S105C6T6和STM8S103K3 我想,我试着在文件中说出来。 有人可以向我展示示例代码(对于Cosmic编译器很棒)。 谢谢提前。 以上来自于谷歌翻译 以下为原文 I try to modify code from TSL V.2.4.0 in ''Example01_STM8S207_RC_5k'' for run on STM8S103K3 and STM8S105C6. Test on board STM8S discovery (for STM8S105C6). Follow TSL document to modify code but it not work. LED is blink (base code on project Adjustable LED blinking speed), but on touch sense notting happen. LED blink speed not change. Both STM8S105C6T6 and STM8S103K3 I think, I try every thing in document say. Can some one show me for the example code (for Cosmic compiler is great). Thank for advance. |
|
相关推荐
5个回答
|
|
你能否更好地描述正在发生/未发生的事情?你做了什么来配置TSL?
如果你的程序正在运行,请观察变量sSCKeyInfo [key_number] .state,sSCKeyInfo [key_number] .Channel.LastMeasure和sSCKeyInfo [key_number]。使用STVD调试器的参考(http://www.st.com/internet/evalboard/产品/ 210567.jsp )或STMStudio(http://www.st.com/internet/evalboard/product/251373.jsp 并描述正在发生的事情。 关键在哪个状态? sSCKeyInfo [key_number] .LastMeasure在您触摸按键时会改变吗? 以上来自于谷歌翻译 以下为原文 Could you please describe better what is happening/not happening? what have you done to configure the TSL? If your program is running, watch the variables sSCKeyInfo[key_number].state, sSCKeyInfo[key_number].Channel.LastMeasure and sSCKeyInfo[key_number].Reference using the STVD debugger (http://www.st.com/internet/evalboard/product/210567.jsp ) or the STMStudio (http://www.st.com/internet/evalboard/product/251373.jsp ) and describe what is happening. In which state are the keys? Is sSCKeyInfo[key_number].LastMeasure changing when you touch the keys? |
|
|
|
我在STM8S105C6上重新检查配置。
我的配置有些错误。 现在它完成了工作。 但是在STM8S103K3上无法正常工作。 在调试中 sSCKeyInfo [KEY_NUMBER] .STATE .whole = 8' b' .b所有值均为0,ERROR为1。 sSCKeyInfo [KEY_NUMBER] .Channel .LastMeasure = 0 .Reference = 0 然后我尝试一步。 在TSL_Action()设置断点; 当调用TSL_Action();大概3-4次。 sSCKeyInfo [key_number] .state.b.CALIBRATION设置为1。 之后,ERROR设置为1。 ERROR设置为1后,值永远不会改变。(触摸或不触摸) 对于STM8S103K3,我使用STM8S发现板 移除STM8S105C6并从STM8S103的引脚重新接线到CN1,CN2,CN3和CN4。 并像这样连接引脚 TL_Load是PE5 点触发是PB0 LED是PC1 与STM8S105C6不同,因为它易于接线。 我想这些信息可能很有用。 我没有示波器但是,我在TS_Load尝试电压表。 在STM8S105C6上的值约为2 V. 但STM8S103K3为0 V. 现在,接下来我该怎么办? 一些配置 / *根据您使用的目标STM8S或STM8A设备取消注释以下行 应用。 * / / * #define STM8S208 * / / *!&lt; STM8S带CAN * /的高密度设备 / * #define STM8S207 * / / *!&lt; STM8S不带CAN * /的高密度设备 / * #define STM8AF52Ax * / / *!&lt; STM8A带CAN * /的高密度设备 / * #define STM8AF62Ax * / / *!&lt; STM8A不带CAN * /的高密度设备 / * #define STM8S105 * / / *!&lt; STM8S中密度设备* / / * #define STM8AF626x * / / *!&lt; STM8A中密度设备* / #define STM8S103 / *!&lt; STM8S低密度设备* / / * #define STM8S903 * / / *!&lt; STM8S低密度设备* / 以上来自于谷歌翻译 以下为原文 I recheck config on STM8S105C6. My configuration some value wrong. Now it's work done. But on STM8S103K3 not work. in debugging sSCKeyInfo[key_number].state .whole = 8 'b' .b all value is 0 only ERROR is 1. sSCKeyInfo[key_number].Channel .LastMeasure = 0 .Reference = 0 Then I try step run. Set break point at TSL_Action(); When call TSL_Action(); about 3-4 time. sSCKeyInfo[key_number].state.b.CALIBRATION set to 1. After that ERROR is set to 1. Value never change after ERROR set to 1. (with touch or not touch) For STM8S103K3, I use STM8S discovery board by remove STM8S105C6 and re wiring from STM8S103's pin to CN1, CN2, CN3 and CN4. And connect pin like this TL_Load is PE5 Point touch sence is PB0 LED is PC1 Not same as STM8S105C6 because it's easy to wire. I guess this information may be usefull. I not have oscilloscope but, I try volt meter at TS_Load. On STM8S105C6 value is about 2 V. but STM8S103K3 is 0 V. Now, what can I do next ? Some configuration /* Uncomment the line below according to the target STM8S or STM8A device used in your application. */ /* #define STM8S208 */ /*!< STM8S High density devices with CAN */ /* #define STM8S207 */ /*!< STM8S High density devices without CAN */ /* #define STM8AF52Ax */ /*!< STM8A High density devices with CAN */ /* #define STM8AF62Ax */ /*!< STM8A High density devices without CAN */ /* #define STM8S105 */ /*!< STM8S Medium density devices */ /* #define STM8AF626x */ /*!< STM8A Medium density devices */ #define STM8S103 /*!< STM8S Low density devices */ /* #define STM8S903 */ /*!< STM8S Low density devices */ |
|
|
|
#define MCU_SELECTION(4)
#define TIMACQ(TIM2) #define TIMACQ_CNTR_ADD(0x530C) #define TIMTICK(TIM4) #define LOADREF_PORT_ADDR(GPIOE_BaseAddress)/ **&lt; LOADREF引脚GPIO基地址* / #define LOADREF_BIT(0x20)/ **&lt; LOADREF引脚掩码* / #define SCKEY_P1_KEY_COUNT(1) #define SCKEY_P1_PORT_ADDR(GPIOB_BaseAddress)/ **&lt;单通道密钥端口1:GPIO基地址* / #define SCKEY_P1_A(0x01)/ **&lt;单通道键端口1:第一键掩码* / #define SCKEY_P1_B(0)/ **&lt;单通道键端口1:第二键掩码* / #define SCKEY_P1_C(0)/ **&lt;单通道键端口1:第三键掩码* / #define SCKEY_P1_D(0)/ **&lt;单通道键端口1:第四键掩码* / #define SCKEY_P1_E(0)/ **&lt;单通道键端口1:第五键掩码* / #define SCKEY_P1_F(0)/ **&lt;单通道键端口1:第六键掩码* / #define SCKEY_P1_G(0)/ **&lt;单通道键端口1:第7键掩码* / #define SCKEY_P1_H(0)/ **&lt;单通道键端口1:第8键掩码* / #define SCKEY_P1_DRIVEN_SHIELD_MASK(0x00) #define GPIOA_ELECTRODES_MASK(0x00)/ **&lt; GPIOA的电极掩膜* / #define GPIOB_ELECTRODES_MASK(0x01)/ **&lt; GPIOB的电极掩膜* / #define GPIOC_ELECTRODES_MASK(0x00)/ **&lt; GPIOC的电极掩模* / #define GPIOD_ELECTRODES_MASK(0x00)/ **&lt; GPIOD的电极掩膜* / #define GPIOE_ELECTRODES_MASK(0x00)/ **&lt; GPIOE的电极掩膜* / #define GPIOF_ELECTRODES_MASK(0x00)/ **&lt; GPIOF的电极掩模* / #define GPIOG_ELECTRODES_MASK(0x00)/ **&lt; GPIOG的电极掩膜* / #define GPIOH_ELECTRODES_MASK(0x00)/ **&lt; GPIOH的电极掩膜* / #define GPIOI_ELECTRODES_MASK(0x00)/ **&lt; GPIOI的电极掩膜* / 以上来自于谷歌翻译 以下为原文 #define MCU_SELECTION (4) #define TIMACQ (TIM2) #define TIMACQ_CNTR_ADD (0x530C) #define TIMTICK (TIM4) #define LOADREF_PORT_ADDR (GPIOE_BaseAddress) /**< LOADREF pin GPIO base address */ #define LOADREF_BIT (0x20) /**< LOADREF pin mask */ #define SCKEY_P1_KEY_COUNT (1) #define SCKEY_P1_PORT_ADDR (GPIOB_BaseAddress) /**< Single channel key Port 1: GPIO base address */ #define SCKEY_P1_A (0x01) /**< Single channel key Port 1: 1st key mask */ #define SCKEY_P1_B (0) /**< Single channel key Port 1: 2nd key mask */ #define SCKEY_P1_C (0) /**< Single channel key Port 1: 3rd key mask */ #define SCKEY_P1_D (0) /**< Single channel key Port 1: 4th key mask */ #define SCKEY_P1_E (0) /**< Single channel key Port 1: 5th key mask */ #define SCKEY_P1_F (0) /**< Single channel key Port 1: 6th key mask */ #define SCKEY_P1_G (0) /**< Single channel key Port 1: 7th key mask */ #define SCKEY_P1_H (0) /**< Single channel key Port 1: 8th key mask */ #define SCKEY_P1_DRIVEN_SHIELD_MASK (0x00) #define GPIOA_ELECTRODES_MASK (0x00) /**< Electrodes mask for GPIOA */ #define GPIOB_ELECTRODES_MASK (0x01) /**< Electrodes mask for GPIOB */ #define GPIOC_ELECTRODES_MASK (0x00) /**< Electrodes mask for GPIOC */ #define GPIOD_ELECTRODES_MASK (0x00) /**< Electrodes mask for GPIOD */ #define GPIOE_ELECTRODES_MASK (0x00) /**< Electrodes mask for GPIOE */ #define GPIOF_ELECTRODES_MASK (0x00) /**< Electrodes mask for GPIOF */ #define GPIOG_ELECTRODES_MASK (0x00) /**< Electrodes mask for GPIOG */ #define GPIOH_ELECTRODES_MASK (0x00) /**< Electrodes mask for GPIOH */ #define GPIOI_ELECTRODES_MASK (0x00) /**< Electrodes mask for GPIOI */ |
|
|
|
密钥进入错误状态的最常见原因是当实际度量超出允许范围时。
尝试更改配置文件中的SCKEY_MIN_ACQUISITION和SCKEY_MAX_ACQUISITIONdefinition 以上来自于谷歌翻译 以下为原文 The most common cause of the keys going in error state is when the actual measure is out of the allowed range. try changing the SCKEY_MIN_ACQUISITION and SCKEY_MAX_ACQUISITIONdefinition in the configuration file |
|
|
|
我发现了我的问题。
我的触摸按钮使电路不稳定。 当我移除触摸时。它运作正常。 (仅限STM8S103K3,不在STM8S105C6上) 您的指南有助于调试问题。 非常感谢你。 以上来自于谷歌翻译 以下为原文 I found my problem. My touch sence button make circuit unstable. When I remove my touch sence. It working properly. (Only STM8S103K3, not on STM8S105C6) Your guide helpfull to debug problem. Thank you very much. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2730 浏览 1 评论
3239 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1808 浏览 1 评论
3647 浏览 6 评论
6035 浏览 21 评论
1338浏览 4评论
198浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
442浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
273浏览 2评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 00:41 , Processed in 1.402491 second(s), Total 56, Slave 50 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号