Array adresses

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
eeEn_4618901
Level 4
Level 4
5 likes given First like received First like given

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?

pastedImage_2.png

Best Regards...

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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...

View solution in original post

0 Likes
8 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

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

0 Likes

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.

0x1fff81d80000000000000000........  ==>I'm checking this part. therefore I can not find a solution.
0x1fff81e00000000000000000........
0x1fff81e80000000000000000........
0x1fff81f00000000000000000........
0x1fff81f80000000033303000....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;

}

0 Likes
0x1fff81f80000000033303000....300.

can i check this address 0x1fff81f8

0 Likes

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

Thanks and Regards,
Rakshith M B
0 Likes

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.

Adsız.jpg

0 Likes

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.

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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...

0 Likes

Hi Motoo,

((uint8_t *) 0x1fff81f8) [4] I can control the bit I want.

Thank you

Best Regards