[XMC4800 Relax EtherCAT Kit Review] + Getting started with DAVE, a preliminary exploration of simple UART applications
[Copy link]
I have got the XMC4800 for almost a week, and I gradually feel the power of the DAVE software. For a certain component, the program calls it APP, which can be directly added, and then the corresponding settings are made, and then the code is generated. Users only need to pay attention to their main, and for related sans-serif]APPmodule, in the generated code, there are actually routines for the use of each function. This time, I simply applied UART, and it was very simple to realize the serial port sending data. The specific process is as follows for your reference: 1. The specific method of creating a new DAVE project and adding the APP module will not be introduced here. You can follow the previous tutorials to build the program and add the UART APP. 2. Here we can focus on the UART settings in the APP, which is the 8-1-n method with a baud rate of 9600.400665[/attach] 3. To use the serial port in the USB debugger, you must check the drawing, where the definition of TX and RX is clear, but the drawing is not particularly clear. Because the debugger uses xmc4200, it feels strange when I first look at this part of the drawing.400666[/attach]
4. Set the corresponding pins and click Generate Code. 5.1. Refer to the example of generated code and write your own main function. After initializing UART, it starts sending data continuously. The code is relatively simple: - int main(void) { DAVE_STATUS_t status; status = DAVE_Init(); /* Initialization of DAVE APPs */ UART_STATUS_t init_status; uint8_t valid_str[] = "hello world!\n"; init_status = (UART_STATUS_t)UART_Init(&UART_0); if(status != DAVE_STATUS_SUCCESS) { /* Placeholder for error handler code. The while loop below can be replaced with an user error handler. */ */ while(1U) { if(init_status==UART_STATUS_SUCCESS){ UART_Transmit(&UART_0, valid_str, sizeof(valid_str)); } } }
复制代码6. Use putty, set the corresponding parameters, and you can see the data information sent by xmc4800. In general, DAVE software allows users who have never been exposed to Infineon products to easily get started and make their own applications. For engineering applications, it greatly improves the efficiency of engineers. Great! ! ! PS:I originally wanted to make a program for timing serial port transmission, but I just came into contact with DAVEsoftware. After studying each module in depth, I will rewrite one. This content is created by flyword, a netizen of EEWORLD forum. If you need to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source
|