- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi;
In my RF transceiver project, the receiver stores the information in rev_array [32]. The transmitter is sending 300 information.
but rev_array [32], starting at 0x1fff81d8, cannot receive data.
0x1fff81d8, 0x1fff81e0,0x1fff81e80x1fff81f0 all become 0.
0x1fff81f8 00 00 00 00 33 30 30 00 .... 300. receiving the address information
Since I have checked the incoming data, I cannot see the related data.
I use the spi block for communication.
What should I do to solve this problem?
Best Regards...
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Tags:
- array
- spi issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
=====
uint8_t *addr = 0x1fff81f8 ;
if (addr[4] == 0x33) && (addr[5]...
=====
moto
Note: I corrected uint32_t* to uint8_t*
also, you could have done like
if (((uint8_t*)0x1fff81f8)[4] ...
not very pretty tough...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You are interfacing the RF tranceiver with the PSoC using SPI interface correct? If no, can you please explain the block diagram of your application? Also, can you please attach the project?
If you are using SPI, then can you probe the lines and check whether the tranceiver is sending the data on the lines?
Thanks
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are interfacing the RF tranceiver with the PSoC using SPI interface correct? ====> yes it works with spi.
information is being sent and received. no problem with that.
RECEIVER();
if(rev_array[0]==0x33 && rev_array[1]==0x30 && rev_array[2]==0x30) { //300
chn=1; }
I check the data received by the receiver.
For example, I check if rev_array[0]==0x33 && rev_array[1]==0x30 && rev_array[2]==0x30)
but rev_array is empty.
0x1fff81d8 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | ........ ==>I'm checking this part. therefore I can not find a solution. |
0x1fff81e0 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | ........ |
0x1fff81e8 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | ........ |
0x1fff81f0 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | ........ |
0x1fff81f8 | 00 | 00 | 00 | 00 | 33 | 30 | 30 | 00 | ....300. |
void RECEIVER(void) {
uint8_t rev_array[SIZE];
LCD_Position(0u,0u);
LCD_PrintString("RX");
to_rx_mode();
CyDelay(800);
uint8_t num=0;
static unsigned int cnt_rx=0;
num = rec_message(rev_array);
rev_array[num] = 0; //tail 0 to make a string.
if (num>0) {
CyDelay(200);
}
}
uint8_t rec_message(uint8_t* p_data)
{
unsigned char i, ret;
ret = 0;
if (!nIRQ0_Read()) {
ItStatus1 = spi_read(0x03); //read the Interrupt Status1 register
ItStatus2 = spi_read(0x04);
ret = spi_read(0x4B); //register@0x4b reveal the received data number.
SpiBurstRead(0x7F,RF_RXBUF,ret); //read back to static array
for (i = 0; i < ret; i++) {
p_data = RF_RXBUF;
}
rx_reset();
}
return ret;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
0x1fff81f8 | 00 | 00 | 00 | 00 | 33 | 30 | 30 | 00 | ....300. |
can i check this address 0x1fff81f8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello eeEn_4618901,
According to my understanding, you are using SPI protocol to receive data from a RX Transeiver. The data is expected to be stored in the array - rev_array[] and when you enter debug mode you are finding that the data in the array is 0. You are finding the value being stored in the address - 0x1fff81f8.
Please correct me if I am wrong.
Have you fixed the address of rev_array? If not, is the address at which you find the data fixed or is it relative to the address of rev_array?
If the address, at which the data is present, is relative to the address of rev_array then you can read the data by providing an offset to the array pointer.
Can you please attach your project so that it will be easier for us to debug? Also, which RX transeiver are you using?
Thanks and Regards,
Rakshith M B
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,Rakshith
I attached Program.
you got it right.==>According to my understanding, you are using SPI protocol to receive data from a RX Transeiver. The data is expected to be stored in the array - rev_array[] and when you enter debug mode you are finding that the data in the array is 0. You are finding the value being stored in the address - 0x1fff81f8.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think I will fix the problem if I can check the address 0x1fff81f8.
How can I access the 0x1fff81f8 address.
if(0x1fff81f8 [4] ==0x33 && 0x1fff81f8 [5] ==0x30 && 0x1fff81f8 [6] ==0x30 ) ==>but it doesn't work that way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
=====
uint8_t *addr = 0x1fff81f8 ;
if (addr[4] == 0x33) && (addr[5]...
=====
moto
Note: I corrected uint32_t* to uint8_t*
also, you could have done like
if (((uint8_t*)0x1fff81f8)[4] ...
not very pretty tough...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Motoo,
((uint8_t *) 0x1fff81f8) [4] I can control the bit I want.
Thank you
Best Regards