FwLib_STC8 icon indicating copy to clipboard operation
FwLib_STC8 copied to clipboard

A lite firmware library for STC8G/STC8H series MCU

Results 14 FwLib_STC8 issues
Sort by recently updated
recently updated
newest added

Hello i try codeing gpio input/output for STC8G1K08A but i can't send output port like arduino ``` #include "fw_hal.h" void GPIO_Init() { GPIO_P3_SetMode(GPIO_Pin_0, GPIO_Mode_Output_PP); } void main() { GPIO_Init(); SYS_SetClock();...

Do you have demo code or a snippet for using I2C slave mode ?

Do you have a demo code or snippet for UART receive mode ?

Can USB be clocked from an external oscillator in STC8H8K64U?

Here the code apply intentional endianness swap due to KEIL C51 using big endian. But SDCC using small endian so no intentional swap is needed. https://github.com/IOsetting/FwLib_STC8/blob/ba28464aa266653d14e679415f662d5b8fbb9bb4/demo/usb/usb_hid.c#L120-L121 Further more if you...

- 针对读取AT24Cxx函数简化,对于AT24C32以下容量的读写是8位地址,AT24C32及以上容量的16位地址位,直接使用宏来区分所需操作的AT24Cxx器件的地址位。可以将现有区分的读写操作函数,合成通用的读写函数。 源文件:`FwLib_STC8\src\fw_i2c.c`: ```c // Copyright 2021 IOsetting // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with...

- 例程路径:FwLib_STC8\FwLib_STC8\demo\i2c\mpu6050: - mpu6050.c内容: ```c uint16_t swap(uint16_t num) { return (num >> 8) | (num #### MPU6050 设备是以大端模式存储的,即高字节在前,低字节在后,在读取原始数据出来后,将高字节的数据左移8位,再或上低字节的数据。 - 是否应该这样处理才合理: ```c uint16_t swap(uint16_t num) { return (num

- 串口2demo:FwLib_STC8\FwLib_STC8\demo\uart\uart2_timer2_tx.c > 在使用串口2的情况下必须要对IO进行配置,否则无法输出。在STC8H手册上(321页)有这么一段话: *** 关于 I/O 的注意事项: 1、 P3.0 和 P3.1 口上电后的状态为弱上拉/准双向口模式 2、 除 P3.0 和 P3.1 外,其余所有 IO 口上电后的状态均为高阻输入状态,用户在使用 IO 口 前必须先设置 IO 口模式 3、 芯片上电时如果不需要使用 USB 进行...

在uart1_timer1_tx.c文件中原外部变量引入: `extern __CODE uint16_t ticks_ms; extern __CODE uint8_t ticks_us, clkdiv;` 需要如下修改: ` #if defined (SDCC) || defined (__SDCC) extern __CODE uint16_t ticks_ms; extern __CODE uint8_t ticks_us; //clkdiv (include fw_reg_stc8h.h) #elif...

在`FwLib_STC8\FwLib_STC8\demo\rtcrtc_interrupt.c`中定义的中断服务函数: ` INTERRUPT(RTC_Routine, EXTI_VectRTC) { .............. } ` >- 📝目前Keil各个版本的C51和C251编译器均只支持32个中断号(0~31),后面的中断需要经过添加汇编调整指令跳转实现。 ### 🛠调整方法: - 🌿将中断号指向13号中断:EXTI_VectUser ` INTERRUPT(RTC_Routine, EXTI_VectUser) { .............. } ` - 🌿在`fw_exti.h`头文件中修改限定宏 ` //#if (__CONF_MCU_TYPE == 1 ) #define...