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.

access to SFR

How can get access to SFR's during production programming. i mean if i want to read port P2 for my testing purpose. 

 

Regards,

 

Abhishek

  • Reading port registers is done exactly the same way as reading/writing ram or reading flash. It's just an address in memory space. It is done through JTAG. The MSP430 lib offers mid-level JTAG support (which is used by every programming software). Using this lib, you can establish a connection to the MSP by your own testing software, and read and write memory locations. (except writing flash, - this is a bit more complex, usually done by writing a small program and the data to MSP ram and executing it)

  • Thanks jens-michael. can you give me an example about these functions. for eg if i want to read port P2  (address 0x0028) what will be my command?

    also can i read  ADC10MEM  to get the voltage output at that pin?

    Thanks

    Abhishek

  • Sorry, I never dealt with JTAG directly. I just got an overview when looking into the MSPGCC project sources to get an idea how it utilizes the libraries.

    Reading a voltage is a little bit mroe complicated than jsut reading a register. You'll need to program the ADC first. (the ADCxMEM registers are not holding a permanently updated conversion result of the input channels - this is only one of many applications and needs to be configured)
    A typical way to do it woudl be to write a program into MSP ram that configures and uses teh ADC module, execute it and pick up the result at the end.

  • Hi Abhishek,

    I don't know what production programmer you are using and therefore what tools might be available to you, but if you are using the MSP-FET430UIF you may want to look into Debug Server Scripting: http://processors.wiki.ti.com/index.php/Debug_Server_Scripting This will let you write a script to program your device, set breakpoints where you read out values of symbols/variables, etc. You could even program your device with a test code, run it, read some data out, then program it with your final production code. For more help you may also want to see the CCS forum.

    There may be other third party options that let you do something similar.

    Regards,

    Katie

  • Thanks katie.

    I am using MSP430 GANG programmer. 

**Attention** This is a public forum