- 2025-01-27
-
发表了主题帖:
年前最后一贴,同志们来顶顶
恭喜发财
诸事顺遂
- 2025-01-26
-
回复了主题帖:
EEWORLD陪你过大年,新年积分兑换盲盒收到啦-UFUN
sujingliang 发表于 2025-1-26 08:19
点赞
- 2025-01-25
-
回复了主题帖:
EEWORLD陪你过大年,新年积分兑换盲盒收到啦-UFUN
sujingliang 发表于 2025-1-25 10:34
资料从这里下:
http://www.wangchaochao.top/2019/03/09/uFun-1/
有原理图
这个板子都有飞线。可 ...
点了一个pdf下载,不行
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>You are denied by bucket referer policy.</Message>
<RequestId>6794CE20D4BE203932BA6907</RequestId>
<HostId>wcc-blog.oss-cn-beijing.aliyuncs.com</HostId>
<BucketName>wcc-blog</BucketName>
<EC>0003-00000503</EC>
<RecommendDoc>https://api.aliyun.com/troubleshoot?q=0003-00000503</RecommendDoc>
</Error>
-
回复了主题帖:
EEWORLD陪你过大年,新年积分兑换盲盒收到啦-UFUN
sujingliang 发表于 2025-1-25 10:34
资料从这里下:
http://www.wangchaochao.top/2019/03/09/uFun-1/
有原理图
这个板子都有飞线。可 ...
感谢大佬分享
- 2025-01-23
-
发表了主题帖:
EEWORLD陪你过大年,新年积分兑换盲盒收到啦-UFUN
UFUN板子 V1
做工很好
MCU是STM32F105RCT6
美中不足的是背板有个飞线
有收到相同的板子吗
资料下载链接都不可用了
大家一起来玩
- 2025-01-22
-
回复了主题帖:
EEWorld邀你来拆解(18期)-----随身WiFi的拆解
看起来不错
-
回复了主题帖:
祝福2025!回帖即有奖!选取最有心的送5块国产开发板!
新年之际,愿你的心灵像嵌入式系统一样纯净高效,过滤掉繁琐与噪音,专注于每一个值得庆祝的美好时刻!
- 2025-01-13
-
回复了主题帖:
EEWORLD陪你过大年,新年积分兑换专场来啦~好物多多还有幸运盲盒!
赞
已兑换
感谢eeworld
- 2024-12-22
-
回复了主题帖:
【Follow me第二季第3期】扩展任务:一个波形信号发生器
breeze_i 发表于 2024-12-21 20:54
大佬,请问视频中用到的串口工具叫什么名字?
mobaxterm
- 2024-12-19
-
回复了主题帖:
【Follow me第二季第3期】作业任务提交
Jacktang 发表于 2024-12-19 07:29
能否加个固件“下载”按钮?
这个是个好建议
每次烧写都只能debug
- 2024-12-18
-
发表了主题帖:
【Follow me第二季第3期】作业任务提交
本帖最后由 Juggernaut 于 2025-1-7 22:57 编辑
首先,真心感谢eeworld && digikey!感谢提供一个很好的学习机会,同时感谢瑞萨做workshop的同学,细致的讲解,反正我看了不下十次。
作业内容:
【所有任务视频】
[localvideo]c462782ae2ee2d7dfb0c2b7a4580262d[/localvideo]
【任务实现详情】
首先环境搭建出了点小问题,全靠教学视频和大佬们的帮助:
1. 【Follow me第二季第3期】哪位真的按照视频指南完成了E2 STUDIO环境搭建? - DigiKey得捷技术专区 - 电子工程世界-论坛
2. 【Follow me第二季第3期】这个estudio神了,环境设置问题 - DigiKey得捷技术专区 - 电子工程世界-论坛
环境搭建好了后的作业:
3.【Follow me第二季第3期】搭建环境&下载调试示例程序 - DigiKey得捷技术专区 - 电子工程世界-论坛
IDE环境是:setup_fsp_v5_6_0_e2s_v2024-1
FSP的案例是:ra-fsp-examples-master
运行demo效果如下:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4. 【Follow me第二季第3期】入门任务:Blink,按键 - DigiKey得捷技术专区 - 电子工程世界-论坛
物料清单:就是EK-RA6M5开发板;
主要思路:通过RASC配置好LED1 LED2和按键;
实现代码:
R_IOPORT_PinRead(&g_ioport_ctrl, BSP_IO_PORT_00_PIN_05, &key_state);
if(key_state==BSP_IO_LEVEL_LOW){
//软件消抖
R_BSP_SoftwareDelay(10, BSP_DELAY_UNITS_MILLISECONDS);
//点亮LED3
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_00_PIN_08, BSP_IO_LEVEL_HIGH); //LED3亮
//等待按键松开
while(key_state==BSP_IO_LEVEL_LOW)
{
R_IOPORT_PinRead(&g_ioport_ctrl, BSP_IO_PORT_00_PIN_05, &key_state);
}
//熄灭LED3
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_00_PIN_08, BSP_IO_LEVEL_LOW); //LED3灭
}
效果图:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5. 【Follow me第二季第3期】基础任务:quad-spi flash和octo-spi flash配置及读写速... - DigiKey得捷技术专区 - 电子工程世界-论坛
物料清单:就是EK-RA6M5开发板;
主要思路:通过RASC配置好QSPI 和 OSPI;
实现代码:
void ospi_performance_test(uint32_t data_size,
uint32_t *ospi_performance_write_result,
uint32_t *ospi_performance_read_result)
{
fsp_err_t err;
uint32_t i = 1;
if (R_CGC_Open (g_cgc.p_ctrl, g_cgc.p_cfg) != FSP_SUCCESS)
{
__asm("bkpt");
}
while (i)
{
err = R_OSPI_Open(g_ospi.p_ctrl, g_ospi.p_cfg);
if (FSP_SUCCESS != err)
{
__asm("bkpt");
}
#if HIGH_SPEED_MODE
configure_dopi_ospi();
ospi_test_wait_until_wip();
#endif
*ospi_performance_write_result = write_dopi_ospi(data_size);
ospi_test_wait_until_wip();
*ospi_performance_read_result = read_dopi_ospi(data_size);
ospi_test_wait_until_wip();
erase_dopi_ospi();
ospi_test_wait_until_wip();
#if HIGH_SPEED_MODE
configure_spi_ospi();
ospi_test_wait_until_wip();
#endif
err = R_OSPI_Close(g_ospi.p_ctrl);
if (FSP_SUCCESS != err)
{
__asm("bkpt");
}
i--;
}
}
static uint32_t qspi_write_test(uint32_t block_size)
{
fsp_err_t fsp_err;
uint32_t qspi_write_result = 0;
timer_status_t status = {};
fsp_err_t err = FSP_SUCCESS;
spi_flash_protocol_t current_spi_mode;
/* Convert from kB */
block_size *= 1024;
/* The comms mode is EXTENDED_SPI by default */
current_spi_mode = SPI_FLASH_PROTOCOL_EXTENDED_SPI;
/* initialise the QSPI, and change mode to that set in FSP */
err = qpi_init();
if (FSP_SUCCESS == err)
{
/* The comms mode has changed. So if recovering, this new mode required */
current_spi_mode = g_qspi_cfg.spi_protocol;
}
uint32_t page_write_count = 0;
uint8_t * p_mem_addr;
/* Cast to req type */
p_mem_addr = (uint8_t *)QSPI_DEVICE_START_ADDRESS;
while (((page_write_count * SECTOR_SIZE) < block_size)
&& ( FSP_SUCCESS == err ) )
{
/* Erase Flash for one sector */
err = R_QSPI_Erase(&g_qspi_ctrl, p_mem_addr, SECTOR_SIZE);
if (FSP_SUCCESS != err)
{
sprintf(s_print_buffer, "R_QSPI_Erase Failed\r\n");
}
else
{
err = get_flash_status();
if (FSP_SUCCESS != err)
{
sprintf(s_print_buffer, "Failed to get status for QSPI operation\r\n");
}
/* Verify the erased block data */
uint32_t count;
for (count = 0; count < SECTOR_SIZE; count++ )
{
if (DEFAULT_MEM_VAL != p_mem_addr[count])
{
/* Verification failed, perhaps the ERASE failed */
err = FSP_ERR_NOT_ERASED;
}
}
}
p_mem_addr += SECTOR_SIZE;
page_write_count++;
}
/* Start the test timer */
fsp_err = R_GPT_Start(g_memory_performance.p_ctrl);
/* Handle error */
if (FSP_SUCCESS != fsp_err)
{
/* Fatal error */
SYSTEM_ERROR
}
/* Cast to req type */
p_mem_addr = (uint8_t *)QSPI_DEVICE_START_ADDRESS;
page_write_count = 0;
while (((page_write_count * PAGE_WRITE_SIZE) < block_size)
&& (FSP_SUCCESS == err))
{
if (FSP_SUCCESS == err)
{
/* Write data to QSPI Flash */
/* Each block begins one character shifted along the source text. To avoid regular striping in memory */
err = R_QSPI_Write(&g_qspi_ctrl, &(sp_source[page_write_count]), p_mem_addr, PAGE_WRITE_SIZE);
if (FSP_SUCCESS != err)
{
sprintf(s_print_buffer, "R_QSPI_Write Failed\r\n");
}
else
{
err = get_flash_status();
if (FSP_SUCCESS != err)
{
sprintf(s_print_buffer, "Failed to get status for QSPI operation\r\n");
}
}
}
p_mem_addr += PAGE_WRITE_SIZE;
page_write_count++;
}
/* close QSPI module */
deinit_qspi(current_spi_mode);
fsp_err = R_GPT_Stop(g_memory_performance.p_ctrl);
/* Handle error */
if (FSP_SUCCESS != fsp_err)
{
/* Fatal error */
SYSTEM_ERROR
}
fsp_err = R_GPT_StatusGet(g_memory_performance.p_ctrl, &status);
/* Handle error */
if (FSP_SUCCESS != fsp_err)
{
/* Fatal error */
SYSTEM_ERROR
}
fsp_err = R_GPT_Reset(g_memory_performance.p_ctrl);
/* Handle error */
if (FSP_SUCCESS != fsp_err)
{
/* Fatal error */
SYSTEM_ERROR
}
qspi_write_result = status.counter;
return (qspi_write_result);
}
效果图:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6. 【Follow me第二季第3期】基础任务:DAC配置生成波形及性能测试 - DigiKey得捷技术专区 - 电子工程世界-论坛
物料清单:就是EK-RA6M5开发板;
主要思路:通过RASC配置好DAC和 GPT;
实现代码:
void g_timer0_callback(timer_callback_args_t * p_args)
{
uint16_t dacvalue=0;
static double w=0.0;
w+=M_PI/90;
if(w>=2*M_PI)
{
w=0.0;
}
dacvalue=(sin(w) + 1) / 2 * 4096;
R_DAC_Write(&g_dac0_ctrl, dacvalue);
}
效果图:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7. 【Follow me第二季第3期】进阶任务:示例程序中新增命令打印信息 - DigiKey得捷技术专区 - 电子工程世界-论坛
物料清单:就是EK-RA6M5开发板;
主要思路:找到s_menu_items[]数组,该数组主要用于路由菜单内容,按规定添加测试内容即可;
实现代码:
test_fn kis_follow_menu(void)
{
int8_t c = -1;
bsp_unique_id_t const * p_uid = R_BSP_UniqueIdGet ();
sprintf (s_print_buffer, "%s%s", gp_clear_screen, gp_cursor_home);
/* ignoring -Wpointer-sign is OK when treating signed char_t array as as unsigned */
print_to_console((void*)s_print_buffer);
sprintf (s_print_buffer, MODULE_NAME, g_selected_menu);
/* ignoring -Wpointer-sign is OK when treating signed char_t array as as unsigned */
print_to_console((void*)s_print_buffer);
/* provide small delay so board_status should be up to date */
vTaskDelay (s_ticks_to_wait);
xEventGroupSetBits (g_update_console_event, STATUS_DISPLAY_MENU_KIS);
while (CONNECTION_ABORT_CRTL != c)
{
c = input_from_console ();
if ((MENU_EXIT_CRTL == c) || (CONNECTION_ABORT_CRTL == c))
{
break;
}
}
xEventGroupClearBits (g_update_console_event, STATUS_DISPLAY_MENU_KIS);
return (0);
}
效果图:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8. 【Follow me第二季第3期】扩展任务:一个波形信号发生器 - DigiKey得捷技术专区 - 电子工程世界-论坛
物料清单:就是EK-RA6M5开发板;
主要思路:直接产生正弦波和三角波,保存在数组中,然后将信号类型存储在flash上,此处选择QSPI flash。
实现代码:
size_t half_period = size / 2; // Half period of the triangle wave
for (size_t i = 0; i < size; i++)
{
if (i < half_period)
{
// Rising edge: 0 to 4096
array[i] = (uint16_t) ((double) i / (half_period - 1) * 4096);
}
else
{
// Falling edge: 4096 to 0
array[i] = (uint16_t) ((double) (size - i - 1) / (half_period - 1) * 4096);
}
}
效果图:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
【心得体会】
1. RASC工具真心好用,外设配置个人感觉比cubeMX不相上下;E2 studio第一次用,总体上不错,弱弱的建议:能否加个固件“下载”按钮?
2. 第一次接触信号波形,跟着大部队跌跌撞撞的学习然后实现自己的功能,感觉很棒,要是有个示波器就好了;
3. 任务安排的比较合理,循序渐进,譬如现在让我去做blink的功能,我就会选择中断的方式实现LED灯亮灯灭,而不是最初的监视按键电平。
【源码】
最后,再次感谢eeworld && digikey!!
-
回复了主题帖:
【Follow me第二季第3期】基础任务:DAC配置生成波形及性能测试
根据大佬们的提示从串口发出来数据展示
效果如下:
-
加入了学习《Follow me 第二季第3期成果视频》,观看 成果展示
-
发表了主题帖:
【Follow me第二季第3期】扩展任务:一个波形信号发生器
本帖最后由 Juggernaut 于 2024-12-18 22:52 编辑
一、任务目标
设计一个类似信号发生器功能的例程。可在示例程序上修改。通过命令或按键,设置DAC输出波形,可通过flash存储历史波形等信息。
二、设计思路
直接产生正弦波和三角波,保存在数组中,然后将信号类型存储在flash上,此处选择QSPI flash。
具体交互如下:
三、实现
(一)QSPI R/W
QSPI读写直接配好stack,加上读写函数即可。
readFromFlash/saveToFlash函数:
void readFromFlash(uint8_t *buffer)
{
fsp_err_t err = FSP_SUCCESS;
uint32_t page_read_count = 0;
uint8_t *p_mem_addr = (uint8_t*) QSPI_DEVICE_START_ADDRESS;
spi_flash_protocol_t current_spi_mode;
/* The comms mode of the FLASH device is EXTENDED_SPI by default */
current_spi_mode = SPI_FLASH_PROTOCOL_EXTENDED_SPI;
/* initialise the QSPI, and change mode to that set in FSP */
err = qpi_init ();
if (FSP_SUCCESS == err)
{
/* The comms mode has changed. So if recovering, this new mode required */
current_spi_mode = g_qspi_cfg.spi_protocol;
}
memcpy (&buffer[0], p_mem_addr, 1);
deinit_qspi (current_spi_mode);
}
void saveToFlash(uint8_t *buffer)
{
fsp_err_t err = FSP_SUCCESS;
uint32_t page_write_count = 0;
uint8_t *p_mem_addr = (uint8_t*) QSPI_DEVICE_START_ADDRESS;
spi_flash_protocol_t current_spi_mode;
p_mem_addr = (uint8_t*) QSPI_DEVICE_START_ADDRESS;
err = qpi_init ();
if (FSP_SUCCESS == err)
{
/* The comms mode has changed. So if recovering, this new mode required */
current_spi_mode = g_qspi_cfg.spi_protocol;
}
/* 擦除 QSPI 的指定扇区 */
err = R_QSPI_Erase (&g_qspi_ctrl, p_mem_addr, 4096U);
if (FSP_SUCCESS != err)
{
sprintf (s_print_buffer, "Failed to erase QSPI flash\r\n");
print_to_console ((void*) s_print_buffer);
return;
}
/* 等待擦除完成 */
err = get_flash_status ();
if (FSP_SUCCESS != err)
{
sprintf (s_print_buffer, "Failed to get flash status after erase\r\n");
print_to_console ((void*) s_print_buffer);
return;
}
err = R_QSPI_Write (&g_qspi_ctrl, &buffer[0], p_mem_addr, 1);
if (FSP_SUCCESS != err)
{
sprintf (s_print_buffer, "Failed to write data to QSPI flash\r\n");
print_to_console ((void*) s_print_buffer);
}
else
{
err = get_flash_status ();
if (FSP_SUCCESS != err)
{
sprintf (s_print_buffer, "Failed to get flash status after write\r\n");
print_to_console ((void*) s_print_buffer);
}
}
deinit_qspi (current_spi_mode);
}
(二)正弦波/三角波
正弦波的公式:array = (uint16_t) ((sin ((double) i * 2.0 * 3.1415926 / size) + 1.0) * (4096 / 2.0));
三角波的公式:
size_t half_period = size / 2; // Half period of the triangle wave
for (size_t i = 0; i < size; i++)
{
if (i < half_period)
{
// Rising edge: 0 to 4096
array[i] = (uint16_t) ((double) i / (half_period - 1) * 4096);
}
else
{
// Falling edge: 4096 to 0
array[i] = (uint16_t) ((double) (size - i - 1) / (half_period - 1) * 4096);
}
}
(三)MENU实现
增加一个新的Wave Generator module
wave_generator函数实现如下:
四、测试运行
再来个视频:
[localvideo]595ebe51460d5cb5bb094e5b3a67449d[/localvideo]
-
加入了学习《Follow me第二季第3期 任务汇总》,观看 Follow me第二季第3期 任务汇总
- 2024-12-15
-
加入了学习《【Follow me第二季第3期】EK-RA6M5任务汇总视频》,观看 【Follow me第二季第3期】EK-RA6M5任务汇总视频
-
发表了主题帖:
【Follow me第二季第3期】进阶任务:示例程序中新增命令打印信息
本帖最后由 Juggernaut 于 2024-12-18 22:15 编辑
进阶任务:示例程序中新增命令打印信息
找到s_menu_items[]数组,该数组主要用于路由菜单内容,添加测试内容:
/* Table of menu functions */
static st_menu_fn_tbl_t s_menu_items[] =
{
{"Follow me 3" , kis_follow_menu},
{"Kit Information" , kis_display_menu},
{"Web Server" , eth_emb_display_menu},
{"Network Name Lookup" , eth_www_display_menu},
{"Quad-SPI and Octo-SPI Speed Comparison" , ext_display_menu},
{"Cryptography and USB High speed (MSC)" , enc_display_menu},
{"Next Steps", ns_display_menu },
{"", NULL }
};
加上打印函数kis_follow_menu实现:
/**********************************************************************************************************************
* Function Name: kis_follow_menu
* Description : .
* Return Value : The Kit test demo screen
*********************************************************************************************************************/
test_fn kis_follow_menu(void)
{
int8_t c = -1;
bsp_unique_id_t const * p_uid = R_BSP_UniqueIdGet ();
sprintf (s_print_buffer, "%s%s", gp_clear_screen, gp_cursor_home);
/* ignoring -Wpointer-sign is OK when treating signed char_t array as as unsigned */
print_to_console((void*)s_print_buffer);
sprintf (s_print_buffer, MODULE_NAME, g_selected_menu);
/* ignoring -Wpointer-sign is OK when treating signed char_t array as as unsigned */
print_to_console((void*)s_print_buffer);
/* provide small delay so board_status should be up to date */
vTaskDelay (s_ticks_to_wait);
xEventGroupSetBits (g_update_console_event, STATUS_DISPLAY_MENU_KIS);
while (CONNECTION_ABORT_CRTL != c)
{
c = input_from_console ();
if ((MENU_EXIT_CRTL == c) || (CONNECTION_ABORT_CRTL == c))
{
break;
}
}
xEventGroupClearBits (g_update_console_event, STATUS_DISPLAY_MENU_KIS);
return (0);
}
编译好下载到板子。
1按下去后,因为直接用了KIT INFORMATION的“MODULE_NAME”,故显示“KIT INFORMATION”
也可以修改MODULE_NAME内容,或者在s_print_buffer加入其它要显示的内容。
完成。
-
加入了学习《【Follow me第二季第3期】+ EK_RA6M5作品展示视频》,观看 Follow me第二季第3期 EK_RA6M5作品视频
-
加入了学习《FollowMe第二季第三期-任务提交》,观看 任务提交视频
-
加入了学习《Follow me第二季第3期 视频介绍》,观看 Follow me第二季第3期 任务提交