ΣSigmaStudio Ask AI Русский Log in

Can't set GPIO after performing safeload.

SigmaDSP & SigmaStudio Nando.One May 18, 2016 00:00 2 replies Original on forum ↗
Subscribe
Nando.One Question
May 18, 2016 00:00

Hello there, how are you?

I am developing an application with PIC32 + ADAU1701. I am running short on IO pins of the PIC32, so I decided to use some of the MP pins of the DSP as outputs to expand the number of pins available.

The DSP boots from the microcontroller via SPI normally and works fine. I created my "Safeload" function to change things on the fly without creating pop noises. The strange thing is that, I can set the GPIOs normally, works fine. However, if I ever perform a Safeload operation (such as changing the gain), I can't set the GPIOs anymore. Very strange.

Please find attached my "WRITE_WORD" and "SAFELOAD" functions. My "safeload byte" is 0x3C with the DSP running at 48Khz.

I really have no idea of what's going on. Any help will be highly appreciated!

Thank you.

Audio Signal Processors

SigmaDSP Audio Processors

adau1701

DaveThib Reply
May 19, 2016 00:00

Hello Nando.One,

What is probably happening is that the GPCW bit in the Core Control Register (bit D7) is being cleared. This will disconnect the control port from being able to write to the GPIO registers and returns the control of the GPIO to the DSP core.

In your program the SafeLoadByte is being passed into your routine so I have no way to know what is actually being sent. You probably should read the Core Control Register first then "OR" the safeload trigger bit to the value and write it back to the Core Control Register. This way should you ever make another change elsewhere in your program that changes something in the Core Control register, you would not have to remember that the Safeload routine is also changing the core control register.

Let me know if this is not the solution.

Thanks,

Dave T

Nando.One Reply
May 20, 2016 00:00

Fantastic! Thank you.