Re: The Renesas User's Manual and FSP (The Deep Magic for R4)

The noobs will never use THAT, it's non intuitive. :grin: (Assuming sinking only).
But sounds like an advanced, very capable chip. If only I were 60 YO again, I might order a few. :smiley:

1 Like

Gopher it!

1 Like

Impressive! Keep us posted with your discoveries.

3 Likes

I dunno. Using fsp for renesas is like using ASF for samd or avr, or libsam for Sam3. It's a level down from Arduino, and substantially powerful, but tends toward bloat and isn't the ultimate in speed or power.

I wasn't very impressed with what I looked at in fsp, but then the ra4 has some weirdness to it.

4 Likes

I agree with @westfw - I believe using layers like FSP, is potentially a fast way to get a build up and running. But as mentioned tends to cause bloat and problems, when the functionality of the underlying layer does not match the functionality, you are after.

Some of the other issues or features of the FSP depending on how you look at it:

a) The source code of FSP, is not included in the board releases. So if you have an issue or question on what it does, you not easily find it. The build uses a prebuilt library that is included in the link phase for the FSP code.

You can install the sources on your machine, by doing the appropriate git clone which does recursive submodules...

b) FSP sources are not built as part of the build process - Goes with a), but even if you setup to build from the github sources, it still uses the previously built library.

So if you find issues and wish to change the FSP code, you need to externally build a new version of FSP. Which so far, I have not figured out how to do it on Windows.

But as @Delta_G has found, there are some pluses as well, like providing or pointing out some functionality that Arduino may not be taking advantage to:

With most boards, I start playing with, one of the first things I do is to download the processor reference manual. I also tend to build an excel document with pin information..

Arduino has also provided a more complete (advanced) pin out page as part of:
ABX00080-full-pinout.pdf (arduino.cc)

Which shows most all of the pins that have a timer associated with them. And you can call analogWrite on them. Arduino suggested only using a subset of these. Partially as to avoid trying to describe some complexities, like in the image I included here, I highlighted two pins that can both use the same timer. You should only use one of these pins for PWM in a sketch...

Arduino/FSP - also provided you a way to allocate a timer that has not bee pre-allocated for the standard PWM pins using:

  uint8_t type;
  uint8_t ch = FspTimer::get_available_timer(type);

...
Oops - but I diverge.

2 Likes

Or you replicate the code and change it to what you need, which adds to the bloat.

For example in my UNOR4WMatrixGFX library (now released in library manager :slight_smile: )
I am using the timer code, but I don't want a fixed period. Instead on each interrupt call back, I may choose to update the period. The Timer hardware does this allow this and there was a callback to set the period.

The issue that I ran into, is that the timer has two different ways to do so. One uses a register that is setup to be buffered. It won't actually update the period, untilt he current period has expired, and then update... The other way was to disable the buffered and set the period directly, which I wanted.... The FSP code did not allow for the second way, so I implemented it in my own code. ..

Similar for the changes I did for the servo library. Although during code reviews for that, I moved some of this code into the layer of code in core that calls FSP code, as to not have actual setting of registers in the Servo library.

1 Like

anyone tried OPEN_DRAIN? Not working on me.

void setup() {
  pinMode(13, OUTPUT_OPENDRAIN);
}

void loop() {
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(1000);
}

still lights LED

1 Like

Also looks like from the PDF, not all hardware pins support it?

1 Like

I'm trying open collector just for fun.

Tried nearly all digital pins. It provides 5V like normal OUTPUT when digitalWrite (pin, HIGH).

Core configured as IOPORT_CFG_PMOS_ENABLE. Changed it to IOPORT_CFG_NMOS_ENABLE, but no luck.

1 Like

Yes, it's an easter egg. IIRC that pin also supports capacitive touch.

1 Like

Nice job!

In case you are interested, as I mentioned before, one of the first things I do with new boards is to create excel document with similar data.

3 Likes

I don't understand why the Arduino Core uses one of the proprietary timers for millis()/etc, instead of the ARM Standard SysTick Timer that most other ARM boards use...

There is also CYCCNT in the DWT unit.

I've been generalizing an old SAMD "explorer" program, and it's currently set up to allow poking around on an Uno R4.

1 Like

i can't understand why wifi and minima uses totally different pins. minima has no polyfuse too. this is too much.

2 Likes

I totally agree.

But how would the marketing people handle this? Would it be an R5 or would it be another named model in the R4 family, like the "R4 done it right"?

It will be down to cost cutting to get it down to the required selling price.

1 Like

PCBs are very cheap. Assembly is much cheaper than it used to be, but I don't believe that it quite qualifies as "cheap" - someone could try it, but I think you'd end up spending at least $50/board for q10 boards of R4 Minima complexity.

Note that the current R4 Minima board already has a spot to put a crystal (but not the WiFi version.) So theoretically you can add a crystal and just modify the software.

3 Likes

I believe that @susan-parker posted how to do it in a post she made.

However, to be strictly legal it needs all the FCC and CE tests redoing once you make a change like this before it can be considered a legal product you can sell. There are other certifications for other countries, see the back of the appropriate R4 board for a list. Note as the WIFI is an intentional emitter it will be a different set of tests that the Minima.

1 Like

As an example: dual PCM1794A DACs, each operating in mono-mode; and yes it does work!

1 Like

Here in the UK one can self-certify for the CE mark. Just be sure you know enough about what you are doing to take that call - noting that actual test equipment that can measure the spectrums of interest helps here.

My modification to add a crystal was using what I had to hand - agreed that fitting a small 3x2mm part would be a better solution - and should have lower emissions.

Do "prototypes" or "lab gear" need FCC/CE approval? Especially for Low-voltage, not-intentional-emitter things? (Perhaps, if you were to want to sell it...)

Most Sparkfun and Adafruit boards lack CE/FCC/UL markings; I would assume that means they're not certified?

Yes it would, and so would be illegal to sell.

As you said if you want to sell them they would. Note the CE approval is just a declaration from someone high up in the origination. But if they come round checking, or a rival files a dispute about it, then you would be asked to provide justification as to the claim. Even a change in software in a product can lead to emissions being over the limit when previously it wasn't and so would require re testing. However, if the authoress see that you have test results on an earlier version of the software they tend to be more lenient to those sorts of things.

With FCC, there was a famous case where a German manufacturer changed the colour of an LED on a product, and was heavily fined for not retesting the product. Although some would say that FCC was more of an import control by other means body, and they are much lenient for home grown products.