You are here

Problem to store in memory PSOC | Cypress Semiconductor

Problem to store in memory PSOC

Summary: 3 Replies, Latest post by Bob Marlowe on 09 Jun 2016 07:29 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
jesus.sola9_1581581's picture
7 posts


I have a problem to store a data in memory PSoC . My code is as follows:

uint8 datos [1 ]


datos [ 0] = WriteRequestedParameter- > handleValPair.value.val [ 0];

// Call the function to save

Save_memory ( & datos [ 0] , sizeof (datos), CYBLE_BMP180_PRESSURE_CHAR_HANDLE ) ;

//Function Save

void Save_memory ( uint8 * Data, len uint8 , uint16 attrHandle )


 CYBLE_GATT_HANDLE_VALUE_PAIR_T datos_a_escribir ;          

datos_a_escribir.attrHandle = attrHandle ;     

datos_a_escribir.value.val = Data ;     

datos_a_escribir.value.len = len ;       




If such datos [ 0] contains 48 , I stored in memory 30 and not know why.

- & Are wrong?

- Where I have to put them?

- datos [ ] array has to be a mandatory or may be only uint8 datos ;?

mady's picture
Cypress Employee
964 posts


If I understood correctly, you stored 48, but you see 30 on memory. Please correct me if I understood wrongly.

If so, 30 is hexadecimal value of 48. 0x30 = 48. Please check if there is any confusion caused because of this convention


jesus.sola9_1581581's picture
7 posts

Hellow Madhu, you have understood correctly , send 48 to be stored and keep me in place 30 , always stores 18 numbers less than the original number. This means that stores the number in hexadecimal ? The code would be right then or can store the decimal value directly ?


user_1377889's picture
9279 posts

Looks like the riddle Why is Halloween exactly the same as Christmas? (Answer: 31Oct = 25Dec)

The computer does not store data in hex or in decimal, both are only a way to represent the stored data or us humans, so that we are able to distinguish different information. You just have to check for yourself

  • in which format your number 48 was represented? a decimal?
  • in which format did you read back the result, was it in hexadecimal?

So with Madhu's presumption that 0x30 is equal to 48Dec (or equal to '0' in ASCII) your program is running correctly.



Log in to post new comments.