This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

FRAM_CODE memory consumption

Other Parts Discussed in Thread: RF430FRL152HEVM, RF430FRL152H

Hi,

I want to evaluate the basic functionality of the RF430FRL152HEVM board by reading the value from ADC conversion. I've downloaded the RF430FRL152H_NFC_Only project from your website and I've added a few lines of code for the ADC read function into the main(). Since the FRAM_CODE memory is quite limited, I've found out the code size reached its maximum very quickly. I have one variable (unsigned int  ADC_Value) which is 2 bytes long. But the difference in occupied FRAM_CODE memory when the "ADC_Value = SD14MEM0;" line is commented or uncommented is 146 bytes. This difference depends on the data type of the variable (f.e. for double it's 510 bytes). It's pretty much since the max available code size is up to 1896 bytes. 

I've also discovered it is influenced by the __delay_cycles(); function. If this function is unused, the memory consumption is what I would expected - not that high at all (only a few bytes). 

So, according those experiments I did, I would be very happy to understand how is this possible. Why does the __delay_cycles() function have so big influence to this? How does it work and what is happening in the background?

I would very appreciate somebodies help. Maybe I am just missing something what is quite clear. 

Thank's, 

Vojta

unsigned int ADC_Value = 0;  

void main()
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog

DS = 1; // ROM variable needs to be initialized here
asm ( " CALL #0x5CDA "); // Call ROM function ( Initialize function pointers)
asm ( " CALL #0x5CAC "); // Call ROM function ( Check part configuration)


initISO15693(CLEAR_BLOCK_LOCKS);
DeviceInit();

SD14CTL0 = SD14EN + VIRTGND;
SD14CTL1 = SD14UNI + SD14INTDLY0;

while(1)
{
SD14CTL0 |= SD14SC;
__delay_cycles(100);
ADC_Value = SD14MEM0;   

//__bis_SR_register(LPM3_bits + GIE);

}

(

  • There was a recent RF430FRL15xH firmware release, so if you downloaded that firmware within a week you should have the latest.

    The delay_cycles is actually a function that takes up place in your program.
    I would recommend that it be not used. Rather use a low-power-mode(LPM). Simply configure the SD14, go into a LPM3 and when the SD14 results are complete, an interrupt will be fired and the SD14 ISR will be executed. In the ISR you can read out the SD14MEM0 register and take the processor out of LPM. The ISR will exit and the main loop will run on once and the cycle can repeat.

    Please see an example project on the thread below.
    It includes NFC, SD14 and a custom command firmware examples.

    e2e.ti.com/.../1571230