MX370/470 support? analogWrite? PPS?

Let us know what you think about the chipKIT, and what can be done to make it better!
Post Reply
Ulysses
Posts: 1
Joined: Fri Sep 02, 2016 4:48 pm

MX370/470 support? analogWrite? PPS?

Post by Ulysses » Fri Sep 02, 2016 5:24 pm

I'm bringing up a board with a processor in this family. I think it would be a hoot to have the chipkit core running on it. I am running 1.3.1
What I've got working so far:

1) The 'new' bootloader
2) Digital I/O
3) The UART
4) ADC inputs
5) Timebase for the arduino delay functions seems correct, but I haven't used a stopwatch or anything

PPS appears to be working: when I check the result of mapPps it gives me the expected values for the pin and function type. (i.e. true if the function is available on the mapped pin, false if it isn't)

The problem:
I can't get analogWrite to output PWM on my OC pins. When I try analogWrite(MY_OC_PIN, 128) I get nothing out. When I try analogWrite(NOT_AN_OC_PIN, 128) the non-OC pin turns on. From reading wiring_analog.c this implies that the library is successfully figuring out that OC is supported on the pin and my mapping is basically correct. I've been through all the files for boards in the variants directory that use PPS and I can't figure out what I'm doing wrong. I noticed though that there aren't any supported boards with a mx370 family (330/350/370/430/450/470) processor.

I still suspect a subtle PPS problem. The UART is mapped on boot so subsequent attempts to map it through PPS might be failing silently with no effect.
I haven't tried the SPI bus yet.

I'm really banging my head here. The chipkit variants files are verbose and not the most straightforward things but after the fortieth time through them there's really not that much to them either. Has the MX370 support been tested on actual hardware? Is there a variants file set for this hardware?

Thanks

EmbeddedMan
Posts: 597
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: MX370/470 support? analogWrite? PPS?

Post by EmbeddedMan » Mon Oct 24, 2016 1:51 pm

Hi Ulysses! I don't know of any 370 based board that are currently working, so you're (a little bit) in uncharted waters here.

It seems unlikely to me that the PPS hardware is different in the 370 as compared with, for example, the MX1/2 family, which is working. But there could be some subtle difference nobody's noticed until now that we need to take into account.

If you manually do the mapPPS() calls before hand, does that allow the analogwrite() to work?

See, for example : https://github.com/fubarino/fubarino.gi ... o-Mini-pps

*Brian

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: MX370/470 support? analogWrite? PPS?

Post by majenko » Mon Oct 24, 2016 4:28 pm

One thing to watch out for is to ensure that the "only allow one remap of PPS" bit is not set in the config bits. With that set the chipKIT core will think that it has mapped the IO pin to the right function, but it won't actually have happened.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

Post Reply