当前位置:网站首页>Kt148a voice chip IC software reference code c language, first-line serial port
Kt148a voice chip IC software reference code c language, first-line serial port
2022-07-02 19:41:00 【Qingyue Electronics】
Catalog
4.2 Communication examples F3-- Group play
4.3 Communication command F0 describe 【 Ultra-low power consumption 】
4.4 Communication details and precautions
First line communication protocol
At present, the chip supports one-line serial communication protocol , It is also determined by the time width of high and low levels 0 perhaps 1 .
3.1 Communication format

Be careful : The high level must be in front , Low level is in the rear .
Recommended 200us:600us. Value range : narrow pulse =[150us--400us] Wide pulse [500us--1000us]
Pay attention to 3:1 and 1:3 Level proportion to ensure stable communication .
Pay attention to the beginning 6ms Low level , During initial commissioning , Try to use an oscilloscope or logic analyzer to see , Error in 10% Both sides can accept
1、0x00H To 0xDFH Define a function code for the voice address code .
2、0xFE Is the voice stop code , Send this command to stop playing voice .
3、 The interval between codes must be greater than 20ms
3.2 Communication command
NO. Serial number | Data code | Voice Speech meter |
0 | 0x00 | Retain |
1 | 0x01 | voice 1 |
2 | 0x02 | voice 2 |
3 | 0x03 | voice 3 |
…… | ||
224 | 0xE0~0xEF | 15 Level volume ,0xE0H Is the minimum volume 0,0xEFH Maximum volume ( Power on default ). ( If you need to adjust the volume , Then send the volume code first , Partition 20ms Send the voice code again ) |
225 | 0xF0 | To turn it off . Enter the ultra-low power consumption state =1.7uA, See 4.3 chapter After entering this state , You also need a control chip , You need to lower it first DATA foot 40ms The purpose is to wake up the chip , You can send commands to control normally , |
242 | 0xF2 | Cyclic code -- See 4.1 chapter If you need to cycle a sound , Then send the voice code first , Partition 20ms Retransmit cyclic code ) |
243 | 0xF3 | Code play -- See 4.2 chapter F3H+ Voice address A, Voice address B, Voice address C,… At the playback address A When , Don't interrupt after receiving the code , End of play A, Just play it B, And then play C….F3 And address 20ms Time delay of . And one group of concatenated addresses and the next group of addresses need 40ms Time delay (“F3+ Voice address ” For a set of concatenated addresses ) |
254 | 0xFE | Stop code |
/*******************************************************************************
- Function description : One line communication data transmission 【 Pay attention to debugging , Use an oscilloscope or logic analyzer to check the pulse width 】
- Subordinate module : Inside
- Parameter description :dat = Data to be sent
- Return instructions : nothing
********************************************************************************/
#define IO1_HIGH() JL_PORTA->DIR &= ~BIT(6);JL_PORTA->OUT |= BIT(6);
#define IO1_LOW() JL_PORTA->DIR &= ~BIT(6);JL_PORTA->OUT &= ~BIT(6);
void oneline_send_one_data(u8 dat)
{
u8 i = 0 ;
IO1_LOW() ;/* Now pull the bus down */
udelay(5000) ;/* Time delay 6MS --- Here is the starting signal for initiating communication */
CPU_SR_ALLOC();// Close the interrupt -- Chips are different , The interfaces may be different
OS_ENTER_CRITICAL();// Close the interrupt
for(i=0 ; i<8 ;i++){
if(dat & 0x01){
IO1_HIGH() ;
udelay(500);/* Time delay 600us*/
IO1_LOW();
udelay(170) ;/* Time delay 200us*/
}else{
IO1_HIGH() ;
udelay(170);/* Time delay 200us*/
IO1_LOW();
udelay(500) ;/* Time delay 600us*/
}
dat = dat >> 1 ;/* At the time of sending , Send the highest bit first , Send the next high bit , And so on */
}
IO1_HIGH() ;/* When you are free, just pull the foot up */
OS_EXIT_CRITICAL();// Open the interrupt
/* At the same time pay attention to , When the chip is initialized , Please pull up the signal pin .*/
}
oneline_send_one_data(0x05);// Corresponding to play the 5 Segment sound - Communications give an example F2-- Loop Playback
void oneline_test_CMD_F2(void){
oneline_send_one_data(0x01) ;
udelay(20) ;/* Time delay 25ms*/
oneline_send_one_data(0xF2) ;
udelay(20) ;/* Time delay 25ms*/
} To achieve the effect of , It's the first sound , Loop Playback , Don't stop . If you need to stop , Can send FE Instructions
4.2 Communications give an example F3-- Group play
void oneline_test_CMD_F3(void){
oneline_send_one_data(0xF3) ;
udelay(20) ;/* Time delay 25ms*/
oneline_send_one_data(0x01) ;
udelay(20) ;/* Time delay 25ms*/
oneline_send_one_data(0x02) ;
udelay(20) ;/* Time delay 25ms*/
oneline_send_one_data(0x03) ;
udelay(20) ;/* Time delay 25ms*/
} Group play No 1 paragraph 、 The first 2 paragraph 、 The first 3 Segment sound , Play in sequence . If you need to stop , Can send FE Instructions
meanwhile , In the process of combined playing , New combined playback data received , Will stop the current combo playback , Go ahead and play the new command
4.3 Communications Instructions F0 describe 【 Ultra-low power consumption 】
1、 Designed for chip access to ultra low power , Because the chip after the playback , Will automatically enter standby mode , Power consumption is maintained at 25uA .
2、 If the power consumption of the chip is lower , You need to send F0 Instructions , In any state
3、 The chip receives F0 After the instruction , Will enter the shutdown state , Power consumption is maintained at 1.7uA about
4、 If the chip needs to receive instructions again , You must first dat Signal down 40ms, Let the chip wake up , Just send the data
4.4 Communications Detail Notes
1、 control MCU After power on , The first time we need to communicate IO, That is to say ONELINE Pin is set to high level output
2、 Try and KT148A Communication between chips , strand 1K The resistance of , To adapt to different levels
3、 Chip 2 foot PB9, On the air , The voltage is about 3.1V about . Once idle , this IO Will become 2.8V about
Because there is a mechanism for idle to enter low-power standby in the chip .
边栏推荐
- Data dimensionality reduction principal component analysis
- AcWing 1137. Select the best line solution (the shortest circuit)
- c语言里怎么设立优先级,细说C语言优先级
- R语言使用econocharts包创建微观经济或宏观经济图、indifference函数可视化无差异曲线(indifference curve)
- 定了,就是它!
- 中缀表达式转换为后缀表达式(C语言代码+详解)
- Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode
- 451-memcpy、memmove、memset的实现
- Microservice technology - distributed global ID in high concurrency
- 使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
猜你喜欢

KT148A语音芯片ic的硬件设计注意事项

Embedded (PLD) series, epf10k50rc240-3n programmable logic device

SQLite 3.39.0 发布,支持右外连接和全外连接

Introduction to mongodb chapter 03 basic concepts of mongodb

ShardingSphere-JDBC5.1.2版本关于SELECT LAST_INSERT_ID()本人发现还是存在路由问题

Py之interpret:interpret的简介、安装、案例应用之详细攻略

MySQL function

Yes, that's it!

良心总结!Jupyter Notebook 从小白到高手,保姆教程来了!

Data dimensionality reduction principal component analysis
随机推荐
Py's interpret: a detailed introduction to interpret, installation, and case application
4274. Suffix expression - binary expression tree
JS如何取整数
解决方案:VS2017 无法打开源文件 stdio.h main.h 等头文件[通俗易懂]
定了,就是它!
函数高阶-柯里化实现
AcWing 1128. 信使 题解(最短路—Floyd)
Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
2022.7.1-----leetcode. two hundred and forty-one
Cuckoo filter
KT148A语音芯片ic的开发常见问题以及描述
Bubble sort array
RPD出品:Superpower Squad 保姆级攻略
Pytorch版本、CUDA版本与显卡驱动版本的对应关系
End to end object detection with transformers (Detr) paper reading and understanding
KT148A语音芯片ic的用户端自己更换语音的方法,上位机
SIFT feature point extraction "suggestions collection"
《MongoDB入门教程》第03篇 MongoDB基本概念
开始练习书法
LeetCode 0871.最低加油次数 - 类似于POJ2431丛林探险