This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

uVision debugger problem

I'm working with the Silab C8051F930.
this is the code i can see in the debugger

    83:   SPI1DAT =  biDataIn ;                         // write data register
C:0x3848    8F86     MOV      B_Enrgy_TH(0x86),R7
    84:   while (!TXBMT1);                              // wait on TXBMT
C:0x384A    30B1FD   JNB      TXBMT1(0xB0.1),C:384A
    85:   while ((SPI1CFG & M_SPIBSY1) == M_SPIBSY1);   // wait on SPIBSY
C:0x384D    E584     MOV      A,SPI1CFG(0x84)
C:0x384F    20E7FB   JB       0xE0.7,C:384D
    86:   bValue = SPI1DAT;                             // read value
C:0x3852    858616   MOV      0x16,B_Enrgy_TH(0x86)
    87:   SPIF1 = 0;                                    // leave SPIF cleared
    88:

SPI1DAT (line 83) is expressed as B_Enrgy_TH(0x86).
SPI1DAT is indeed SFR (0x86) in SFR page 0x0. it is not clear where from this register got the name B_Enrgy_TH. i have no such varaible in the program.
i did use such variable in previous project, but how is it popping up hear?
besides, the main issue is when i check SPI1DAT i see it doesn't get the value i write into it.

any idea for the reason?

Parents
  • Hi Andy, thanks for the response.
    i have 2 SFR pages, (0x0 and 0xF). in this stage of the program the LEGACY_PAGE (0x0) is defined. i can also see in the SFRPAGE reg that it is indeed defined correctly. you can also see that SPI1CNFG is identified correctly (line 85) and this SFR is on the same SFRPAGE as SPI1CTL.
    any how there is no any variable or SFR in my program with the name B_ENRGY_TH. as mentioned before i had such variable in one of my old projects (I indeed copied some of the files from that old project to this project), but still in this project there is nor such variable neither
    SFR.

Reply
  • Hi Andy, thanks for the response.
    i have 2 SFR pages, (0x0 and 0xF). in this stage of the program the LEGACY_PAGE (0x0) is defined. i can also see in the SFRPAGE reg that it is indeed defined correctly. you can also see that SPI1CNFG is identified correctly (line 85) and this SFR is on the same SFRPAGE as SPI1CTL.
    any how there is no any variable or SFR in my program with the name B_ENRGY_TH. as mentioned before i had such variable in one of my old projects (I indeed copied some of the files from that old project to this project), but still in this project there is nor such variable neither
    SFR.

Children