udi_cdc_getc() not working in SAM E70

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have SAM E70 and I want to get character using udi_cdc_getc() through hyperterminal and echo back using udi_cdc_putc().

The problem is udi_cdc_is_rx_ready() is always false, even when I type letters in hyperterminal. However, udi_cdc_putc() does work by itself when I put udi_cdc_putc(67) it shows "C" in hyperterminal.

Am I doing something wrong?

 

Below is my entire code:

 


#include <asf.h>
#include "conf_usb.h"
#include "ui.h"
#include "uart.h"
static volatile bool main_b_cdc_enable = false;

int main(void)
{
    irq_initialize_vectors();
    cpu_irq_enable();
    sleepmgr_init();
#if !SAM0
    sysclk_init();
    board_init();
#else
    system_init();
#endif
    ui_init();
    ui_powerdown();

    udc_start();
    stdio_usb_enable();

    int input;

    while (true) {

    if (udi_cdc_is_rx_ready())
    {
    input = udi_cdc_getc();
    udi_cdc_putc(input);

    }

    }
}

Thanks in advance.

Last Edited: Tue. Jul 26, 2016 - 03:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey did you manage to fix your issue?