• 0

Analogshield and ChipKIT Wi-FIRE

Go to solution Solved by mwingerson,


Does anyone know if AnalogShield will work on the new ChipKit Wi-FIRE (with few modifications) ?

I look inside the library and I saw several " #ifdef __PIC32MX__ "

However the new ChipKit WI-FIRE is " PIC32MZ ", MZ not MX. In other words, without any modification it will not work. However, if the chip is similar, as described in this forum, should be easy.


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
  • Solution

Hello adralencar,

I moved your post to a new thread since it is a great question.

The library for the analogShield would be easy to modify for the Wi-FIRE.  Simply, replace all of the

      "#if defined (__PIC32MX__)"


      "#if defined (__PIC32MX__) || defined (__PIC32MZXX__)".  


      "#if defined (__PIC32MX__) || defined (__SAM3X8E__)"


     "#if defined (__PIC32MX__) || defined (__PIC32MZXX__) || defined (__SAM3X8E__)"

I would definitely pull your changes into the master branch, if you update the library for this.

Tell me how it goes.


Link to post
Share on other sites
  • 0

Thank you Marshall!

Currently I already made my application to run using Chipkit UNO32 and MAX32 (together with AnalogShield). My next step is to test in a Arduino DUE (I already got one).

My application is in scientific research, so I need as much speed as I can get (to increase time resolution). Thus very soon I will buy the Wi-FIRE to test it.

Do you have any suggestion to speed up the SPI transmission (ChipKit to AnalogShield)? In my application, once I reach 500 Hz wave, or above, I start to see time quantization, probable due the SPI speed. I realize that the AnalogShield do not use the buffered DSPI. Any clue?

This is the piece of my current code, which is inside a loop:

          mag_out = -1 + MED_VALUE*(1+sin(pi2_mil* time));
          #ifdef ANALOG_SHIELD


Thank you,



Link to post
Share on other sites
  • 0

I haven't been able to test the latest build of the AnalogShield library on the DUE since I do not have a DUE.  I suspect the DUE will not perform as well as the ChipKIT due to the optimizations in place for PIC32.  Regardless, I would like to know the results.

Unfortunately, I never got around to putting the DSPI library into the ChipKIT part of the library.  If I remember right, the SPI module on the PIC32 can run up to 20MHz.  I do not know what the stock speed is in the SPI library.  

I am surprised that you are seeing distortion at that slow of a speed.  I got the library running about as fast as the ADC and DAC can run on a UC32.  Can you post your entire sketch and I might be able to spot something that might cause the slow down?




Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now