Quantcast
Viewing all articles
Browse latest Browse all 59170

Forum Post: RE: Serial port settings for debug?

Dear Sir DJ Delorie, Could you kindly  explain me how you use UART in SPI communication? Do I need  write any cross protocol in my  code?  Selecting slave or master SPI, what would be code configuration? My master is YRDKRX63N and slave is ADAS1000 from Analog device. How we can get things in realterm? I have executed a sample code of renesas kit that receives data in realterm. I need to moderate code for UART, matching baud rate with UART and PC. Here is my slave SCI  command written in Communication Driver for RENESAS RX63N, unsigned char SCI_Init(void) { unsigned char status = 1; R_SCI_Set(            // PDL_SCI_PIN_SCI2_B pins 2, PDL_SCI_PIN_SCI2_TXD2_P13 ); R_SCI_Create(2,               // Channel 2. PDL_SCI_ASYNC |             // Asynchronous operation mode.    PDL_SCI_TX_CONNECTED |      // The TX output is required.    PDL_SCI_RX_DISCONNECTED |   // The RX input is not required.    PDL_SCI_HW_FLOW_NONE |      // The SCK pin functions as an I/O pin.    PDL_SCI_LSB_FIRST |         // 8-bit data length.    PDL_SCI_CLK_INT_IO |        // No parity bit.    PDL_SCI_8_BIT_LENGTH |      // One stop bit.    PDL_SCI_PARITY_NONE |    PDL_SCI_STOP_1, BIT_31 | PDL_SCI_PCLK_DIV_1 | PDL_SCI_CYCLE_BIT_8 | 25 | (115384 & 0x00FFFF00ul), // The transfer bit rate. 1,                          // Interrupt priority 0 ); return status; } here is UART code for ADAS1000 slave   //Ouput the on the UART the frames read from the ADAS1000 for(frame = 0; frame 24000; frame++) { decimalToAscii(dataBuffer[frame], ascii); SCI_Write((unsigned char*)&ascii[0], 1); SCI_Write((unsigned char*)&ascii[1], 1); SCI_Write((unsigned char*)&ascii[2], 1); character = 0x2C; // , (comma) SCI_Write((unsigned char*)&character, 1); character = 0x20; // SP  (Space) SCI_Write((unsigned char*)&character, 1); if ((frame + 1) % 24 == 0) { character = 0x0D; // CR (Carriage Return). SCI_Write((unsigned char*)&character, 1); character = 0x0A; // LF (Line Feed). SCI_Write((unsigned char*)&character, 1); } } //Wait indefinitely while(1) { Help me please.

Viewing all articles
Browse latest Browse all 59170