IER Port Devices Driver
The network adapter property sheet in Windows® 10 provides information about the network adapter and driver on the computer. Follow these steps to open the adapter properties: Right-click the Start button. Click Device Manager from the list. Drivers Streaming Device Service Installer ( v6.01.26 (Windows 32 bit & 64 bit)) Supported Devices: (V31x, V371, M31x) Streaming Lumidigm Device Service Installer Win 7+ OS: Embedded Device Drivers Signed for Win7+ Download: V-Series AND M-Series Embedded Driver ( v7.00.00 (64 bit)).
Hi ,
Subject: USART driver using interrupt method for SAMG55J19 device not working as expected
Application : GSM Modem on USART0.
my data length is not fixed.Data is transferring continuously. I want to send the data based on requirement or user selection.Is there any way raise transmit interrupt on program ?
Case 1: USART Transmitting interrupts fired frequently and sending data continuously if the code is in ISR,But not cleared automatically.
US_CSR_TXRDY should be cleared once data is transferred.unable to Unable to set US_CSR_TXRDY and clear the US_CSR_TXRDY flags ?
Is there any way to set and clear the flags in code ?
Case2:
Transmitting is not fired and unable sending data if the flags or code in main.
tx_data_ready = true;
g_tx_done= false;
Hardware details
EXT1 Header.
PA9 RX -- TX (ftdi rs232)
PA10 TX -- RX (ftdi rs232)
GND -- GND (ftdi rs232)
Library version : 3.3
IDE Version : ASF 7.0
OS Version : Windows 7
Demo Code: Yes (Attachment)
Target Device : ATSAMG55J19
Development Board : ATSAMG55-XPRO
Compiler : GCC free compiler
// USART configuration
void USART0_Configutation(void)
{
board_init();
//Initialize system clock:
sysclk_init();
static usart_serial_options_t usart_options = {
.baudrate = USART_SERIAL_BAUDRATE,
.charlength = USART_SERIAL_CHAR_LENGTH,
.paritytype = USART_SERIAL_PARITY,
.stopbits = USART_SERIAL_STOP_BIT
};
const sam_usart_opt_t usart_console_settings = {
USART_SERIAL_BAUDRATE,
USART_SERIAL_CHAR_LENGTH,
USART_SERIAL_PARITY,
USART_SERIAL_STOP_BIT ,
US_MR_CHMODE_NORMAL
};
ioport_init(); // call before using IOPORT service
// configure UART pins
ioport_set_port_mode(IOPORT_PIOA, PIO_PA9A_URXD0 | PIO_PA10A_UTXD0, IOPORT_MODE_MUX_A);
ioport_disable_port(IOPORT_PIOA, PIO_PA9A_URXD0 | PIO_PA10A_UTXD0);
// uart pin configuration
pio_configure(PINS_UART0_PIO, PINS_UART0_TYPE, PINS_UART0_MASK, PINS_UART0_ATTR);
//enable the uart peripherial clock
pmc_enable_periph_clk(USART_SERIAL_ID);
usart_serial_init(USART_SERIAL, &usart_options);
// Interrupt
sysclk_enable_peripheral_clock(USART_SERIAL_ID);
usart_init_rs232(USART_SERIAL, &usart_console_settings,
sysclk_get_main_hz());
///* Disable all the interrupts. */
usart_disable_interrupt(USART_SERIAL, ALL_INTERRUPT_MASK);
usart_enable_tx(USART_SERIAL);
usart_enable_rx(USART_SERIAL);
/* Configure and enable interrupt of USART. */
usart_enable_interrupt(USART_SERIAL, US_IER_RXRDY);
usart_enable_interrupt(USART_SERIAL, US_IER_TXRDY|US_IER_TIMEOUT|US_IER_ENDTX|US_IER_TXBUFE);
//US_IER_TIMEOUT
/* Configure and enable interrupt of USART. */
NVIC_EnableIRQ(USART_IRQn);
}
// ISR code
void USART0_Handler(void)
{
uint32_t l_rx_tx_status = 0;
l_rx_tx_status = usart_get_status(USART_SERIAL);
// case I -working code is working in ISR only
tx_data_ready = true;
g_tx_done= false;
if ( (( l_rx_tx_status & US_CSR_TXRDY ) && tx_data_ready ) && (!g_tx_done)){
usart_serial_write_packet(USART_SERIAL, (const char *)AT_COMMAND, sizeof(AT_COMMAND));
delay_ms(1000);
}
tx_data_ready = false;
g_tx_done = true;
}
//application
int main (void)
{
WDT->WDT_MR = WDT_MR_WDDIS; // disable watchdog
USART0_Configutation();
while(1)
{
// case 2 code not working in application
uint32_t l_rx_tx_status = 0;
l_rx_tx_status = usart_get_status(USART_SERIAL);
tx_data_ready = true;
g_tx_done= false;
if ( (( l_rx_tx_status & US_CSR_TXRDY ) && tx_data_ready ) && (!g_tx_done)){
usart_serial_write_packet(USART_SERIAL, (const char *)AT_COMMAND, sizeof(AT_COMMAND));
delay_ms(1000); // testing purpose
}
tx_data_ready = false;
g_tx_done = true;
}
}
Please do need full.
Ier Port Devices Driver Download
Regards,
Srinivas