Please help me!
I've tried to do this on my own and spent >10 hours trying to get this idea to work, searched for sample software, read the SCB specsheet, searched the net!
I have a CY8KIT-042 eval board(mcu CY8C4245) to use to receive/send binary array of bytes to a PIC MCU, both directly connected Tx<-->RX. configured 115200, 8,n,1 on both mcu's.
The cmd/data sent/received is always a fixed-size array of binary bytes .
The PIC is always the master.
PIC initiates a chat by sending 41 bytes binary. (contained in an array: unsigned char Tx ) to be received and placed into a unsigned char Rx array on the CY8Kit.
The Cypress then sets a flag that a new byte/data pac of 41 bytes has been received and processes the received 41-byte buffer of cmds and data.
The Cy then should Tx back to the Cy8Kit the updated data in its unsigned char Tx
I have the PIC Xmit functioning perfectly Tx'ing the 40-byte array once a second (always same 40 test bytes). I have verified this on my scope.
I can't seem to get any received data into the CY8KIT. I haven't yet begun to write the code sending data back to the PIC.
Here is my HW info and code on the PSOC side of this game:
I configured the std UART SCB: baud 115200,N,8,1
HW: for Tx and Rx
Tx output pin P0 Tx ----->PIC Rx
Rx input pin P0 Rx ------>PIC Tx (using 3-in flying wires for both connections including connecting both Vss(Gnd) and VDD(5V)<
Rx input pin on Cy has 18k pullup to +5
Config of SCB UART UART (alias UA)
Rx and TX
FIFO size: 41
12 x oversampling Rx
System Clock 24Mhz
Only one active Interrupt checked: RX FIFO UNDERFLOW
My Cypress Code:
unsigned char Tx,Rx,rbyt=0;
/* Returns the status/identity of which enabled RX interrupt source caused interrupt event */
uint32 source = UA_GetRxInterruptSource();
/* Checks for "RX FIFO AND not empty" interrupt */
if(0ul != (UA_INTR_RX_NOT_EMPTY & source))
/* Get the character from terminal */
Rx[rbyt] = UA_UartGetByte();
rbyt++; //Counts the number of bytes received
/* Clear UART "RX FIFO not empty interrupt" */
|CyGlobalIntEnable; /* Enable global interrupts. */|
|CySysWdtDisable(0);// Disable, WDT to do nothing on WDT timeout|
// code continues here displays the value of rbyt on the Cy and is now always showing 0 (a multiple digit 7-Seg display.. works 100%)