atmel sensor using printf -
i'm learning embedded system. have atmel uc3-l0 , compass sensor. install atmelstudio , download demo code board. have no idea function "printf" in demo code appear data. how should data?
in order use printf in atmel studio should check following things:
- add , apply standard serial i/o module project->asf wizard.
- also add usart module asf wizard.
- include following code snippet before main function.
static struct usart_module usart_instance; static void configure_console(void) { struct usart_config usart_conf; usart_get_config_defaults(&usart_conf); usart_conf.mux_setting = edbg_cdc_sercom_mux_setting; usart_conf.pinmux_pad0 = edbg_cdc_sercom_pinmux_pad0; usart_conf.pinmux_pad1 = edbg_cdc_sercom_pinmux_pad1; usart_conf.pinmux_pad2 = edbg_cdc_sercom_pinmux_pad2; usart_conf.pinmux_pad3 = edbg_cdc_sercom_pinmux_pad3; usart_conf.baudrate = 115200; stdio_serial_init(&usart_instance, edbg_cdc_module, &usart_conf); usart_enable(&usart_instance); }
make sure call configure_console after system_init() main function.
now go tools->extension manager. add terminal window extension.
- build , run program , open terminal window view-> terminal window. put correct com port device running on , set baud 115200 , hit connect on terminal window.
- you should see printf statements now. (float doesn't printed in atmel studio)
Comments
Post a Comment