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.

PGA460-Q1: How to set window length and start time in software code?

Part Number: PGA460-Q1
Other Parts Discussed in Thread: ENERGIA, PGA460

Hi experts,

It is easy to set WLP and ST in GUI as below. could you please suggest how to do this in software code like Energia ? thanks. 

  • Hi Yue,

    In the PGA460 Energia Library and Code Example (Version 1.0.9) (Rev. I) download, the frequency diagnostic settings are currently configured as part of the bulk EEPROM write command (Energia function "ussc.defaultPGA460"). There is no library function available at this time to update the frequency diagnostics specifically, but you could create one. The easiest way to update the frequency diagnostic settings in Energia today is to use the "byte pga460::registerWrite(byte addr, byte data)" library function. You can see more details on this function in the PGA460_USSC.cpp file, but you'd simply add the following to your Energia sketch:

    ussc.registerWrite(0x23, 0xAA) // write to FREQ_DIAG Register for FDIAG_LEN and FDIAG_START configuration

  • Hi Akeem,

    Shall I add this this command ussc.registerWrite(0x23, 0xAA) before or after the "Configure the EVM in the following order" on Engeria sketch?

    Can I add this command to config other parameter like TVGAIN, PULSE_T1....?

    Thanks,

    Leo

    ussc.registerWrite(0x23, 0xAA)

  • Hi Leo,

    You should add this register write command to configure the frequency diagnostics in the initialization routine of your Energia sketch, after the ussc.defaultPGA460 function. Alternatively, you could update the FREQ_DIAG register value within the defaultPGA460 function's switch-case statement (see file PGA460_USSC.cpp) to avoid having to do an additional registerWrite of the FREQ_DIAG register. The defaultPGA460 function includes a bulk EEPROM write command (command 12) to configure all user registers.

    The registerWrite function (command 10), can be used to write to any device register (TVGAIN, PULSE_P1, etc).