页次: 1
我翻半天也没有翻到,
不过还是有一个版本寄存器
VersionReg,
将就着用吧。
https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
果然有,谢谢大神,
MFRC522 version 1.0 software version is: 91h.
MFRC522 version 2.0 software version is: 92h.
用 xTaskCreatePinnedToCore 创建任务, 最后一个参数就是内核Id, 0第一个, 1第二个.
BaseType_t xTaskCreatePinnedToCore(
TaskFunction_t pxTaskCode,
const char * pcName,
const uint16_t usStackDepth,
void *pvParameters,
UBaseType_t uxPriority,
TaskHandle_t *pxCreatedTask,
const BasType_t xCoreID)
顾名思义, Pin的意思是绑定, Core是核心,
那就是创建一个任务,绑定到指定的核心。
自己搞定了, 参考 https://esp32.com/viewtopic.php?t=72
// simply code
uint8 temper;
float celsius;temper= temperature_sensor_read();
celsius = ( temper - 32 ) / 1.8;
printf("Sensor onBoard is F: %i C: %.2f\n", temper, clesius);
// Main application
void app_main()
{
// disable the default wifi logging
esp_log_level_set("wifi", ESP_LOG_NONE);
// create the event group to handle wifi events
event_group = xEventGroupCreate();
// initialize the tcp stack
tcpip_adapter_init();
// stop DHCP server
ESP_ERROR_CHECK(tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP));
// assign a static IP to the network interface
tcpip_adapter_ip_info_t info;
memset(&info, 0, sizeof(info));
IP4_ADDR(&info.ip, 192, 168, 10, 1);
IP4_ADDR(&info.gw, 192, 168, 10, 1);
IP4_ADDR(&info.netmask, 255, 255, 255, 0);
ESP_ERROR_CHECK(tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &info));
// start the DHCP server
ESP_ERROR_CHECK(tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP));
// initialize the wifi event handler
ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
// initialize the wifi stack in AccessPoint mode with config in RAM
wifi_init_config_t wifi_init_config = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&wifi_init_config));
ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
// configure the wifi connection and start the interface
wifi_config_t ap_config = {
.ap = {
.ssid = CONFIG_AP_SSID,
.password = CONFIG_AP_PASSWORD,
.ssid_len = 0,
.channel = CONFIG_AP_CHANNEL,
.authmode = CONFIG_AP_AUTHMODE,
.ssid_hidden = CONFIG_AP_SSID_HIDDEN,
.max_connection = CONFIG_AP_MAX_CONNECTIONS,
.beacon_interval = CONFIG_AP_BEACON_INTERVAL,
},
};
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &ap_config));
// start the wifi interface
ESP_ERROR_CHECK(esp_wifi_start());
printf("Starting access point, SSID=%s\n", CONFIG_AP_SSID);
// start the main task
xTaskCreate(&monitor_task, "monitor_task", 2048, NULL, 5, NULL);
xTaskCreate(&station_list_task, "station_list_task", 2048, NULL, 5, NULL);
}
[0;32mI (1128) cpu_start: App cpu up.[0m
[0;32mI (1141) heap_alloc_caps: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (1163) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM[0m
[0;32mI (1184) heap_alloc_caps: At 3FFB7A88 len 00028578 (161 KiB): DRAM[0m
[0;32mI (1205) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM[0m
[0;32mI (1226) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
[0;32mI (1248) heap_alloc_caps: At 40093160 len 0000CEA0 (51 KiB): IRAM[0m
[0;32mI (1269) cpu_start: Pro cpu start user code[0m
[0;32mI (1326) cpu_start: Starting scheduler on PRO CPU.[0m
[0;32mI (1331) cpu_start: Starting scheduler on APP CPU.[0m
[0;32mI (1361) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
[0;32mI (1361) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
ESP_ERROR_CHECK failed: esp_err_t 0xb at 0x400df5e8
file: "C:/esp32-tutorial/12_accesspoint/main/main.c" line 168
func: app_main
expression: esp_wifi_set_config(WIFI_IF_AP, &ap_config)
Backtrace: 0x4008687c:0x3ffb88f0 0x40086bf9:0x3ffb8910 0x400df5e8:0x3ffb8930 0x400d08aa:0x3ffb8a00
Rebooting...
ets Jun 8 2016 00:22:57
就酱紫一直重启
http://blog.sina.com.cn/s/blog_13552328d0102vzcr.html
要想了解一键下载电路的工作过程,首先要了解STM32的几种启动模式。
STM32的几种启动模式如下表所示:
从表中可知,我们想用串口下载代码,就要配置BOOT0为1,BOOT1为0,但是如果想让STM32一复位就运行代码,就要配置BOOT0为0,BOOT1配置为什么都可以,为了解决这个问题,我们可以设计一个电路,通过串口转USB芯片CH340G的DTR#和RTS#引脚的信号来控制一键下载电路,从而间接控制STM32的RESET和BOOT0引脚的信号,来达到通过串口一键下载和运行的效果,省去了购买仿真器的费用,下载程序也变得简单方便,一键下载电路如下图所示:
串口下载软件选用的是MCUISP,通过串口的DTR和RTS信号来自动配置BOOT0和RESET信号,不需要用户手动切换它们的状态,直接串口软件自动控制,可以方便的下载代码。
打开 MCUISP,点击搜索串口,将自动找到电路板板载串口,在bps中选择波特率为460800,左下角选择:DTR的低电平复位,RTS 高电平进 BootLoader。再加载烧写文件。
http://blog.csdn.net/haozi0_0/article/details/47275045
硬流控的RTS、CTS:
(现在做串口使用RTS/CTS必看内容,因为MTK/)
RTS (Require ToSend,发送请求)为输出信号,用于指示本设备准备好可接收数据,低电平有效,低电平说明本设备可以接收数据。
CTS (Clear ToSend,发送允许)为输入信号,用于判断是否可以向对方发送数据,低电平有效,低电平说明本设备可以向对方发送数据。
此处有人将CTS翻译为发送允许,我感觉的确比翻译为清除发送好。因为CTS是对方的RTS控制己方的CTS是否允许发送的功能。
页次: 1