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:

  1. add , apply standard serial i/o module project->asf wizard.
  2. also add usart module asf wizard.
  3. 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);     } 
  1. make sure call configure_console after system_init() main function.

  2. now go tools->extension manager. add terminal window extension.

  3. build , run program , open terminal window view-> terminal window. put correct com port device running on , set baud 115200 , hit connect on terminal window.
  4. you should see printf statements now. (float doesn't printed in atmel studio)

Comments

Popular posts from this blog

asp.net mvc 3 - Using mvc3, I need to add a username/password to the sql connection string at runtime -

kineticjs - draw multiple lines and delete individual line -

thumbnails - jQuery image rotate on hover -