Altera_Forum
Honored Contributor
12 years agoWriting Char to On-Chip FIFO
I am trying to take a char array and send it trough a FIFO. but the On-Chip FIFO only accepts alt_u32 as data and i cannot send my data correctly. here is code that i am using to try and send the char array.
for(i=0;i<recvMsgSize+4;i=i+4){
memmove(buffer, echoBuffer+i, 4);
data= atol(buffer);
altera_avalon_fifo_write_fifo(FIFO_BUFFER_IN_BASE, FIFO_BUFFER_IN_CSR_BASE, data);
}
so i am taking the long echoBuffer and splitting it into 4bytes char chucks to send it trough the 32 bit FIFO port. then i try to change it to a alt_u32 and send it trough but all it sends is 0's