user84999: I recently got a Microchip Fubarino, contains a PIC32MX250F128D and I'm totally new to the Arduino IDE, i uploaded the blink sketch all fine and well.
Schematic: FubarinoMini_v15_sch
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
//pinMode(LED_BUILTIN, OUTPUT);


//asm ("BSF PORTA,10");
//pinMode(RA10, OUTPUT);
//TRISA10 = 0;
TRISAbits.RA10 = 0;
//PORTAbits.RA10 = 1;
//PORTAbits.RA10 = 0; // set to output
//mapPps(20, PPS_OUT_SDO2)
}

// the loop function runs over and over again forever
void loop() {
//digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
PORTAbits.RA10 = 1;
delay(500); // wait for a second
//digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
PORTAbits.RA10 = 0;
delay(500); // wait for a second
} 

restults in:
 Blink:45:12: error: 'volatile union __LATAbits_t' has no member named 'RA10'
LATAbits.RA10 = 0;

changing:
void loop() {
  //digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  PORTAbits.RA10 = 1;
  delay(500);                       // wait for a second
  //digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  PORTAbits.RA10 = 0;
  delay(500);                       // wait for a second
}

doesn't work either.
I also tried this example code:
https://github.com/fubarino/fubarino.github.com/wiki/Fubarino-Mini-pps
It does work.
#define LED 1
#define SCK2 4
#define SDI2 18
#define SDO2 20 

The led on the Fubarino board is not connected to pin 1, but to RA10.
Pin 18 is the MCLR on the device, reviewing the datasheet you can't even set SDI2 & SDO2 to the above defined numbers.
Normally on a PIC16F84 or so, you would do something like this.
bank1
movlw b'00000001'
movwf TRISA

movlw b'11110000'
movwf TRISB
bank0 

the Arduino "code" seems a bit abstract.
I Would like to experiment with the button.
The Chipkit pps example shows you can use the Microchip keywords from the devices datasheet.
Can the Fubarino be setup like a classic PIC device in the Arduino IDE?
Configuring all the pins before going in to loop, using the Keywords from the datasheet.

user4143: The entries in the "bits" structures are named after the bits.
It's not
TRISAbits.RA10

but
TRISAbits.TRISA10

The same goes for
LATAbits.LATA10

The only exception is the "port" one
PORTAbits.RA10

Which is a hangover from the old PIC16 chips that didn't have a LATx register.


The led on the Fubarino board is not connected to pin 1, but to RA10.

Pin 1 is RA10. If you look in the file Board_Data.c for the Fubarino_Mini variant (packages/chipKIT/hardware/pic32/2.1.0/variants/Fubarino_Mini/Board_Data.c) you can see all the pin mappings. There's a bunch of arrays there that define how everything fits together.
The second entry in most of those arrays (pin 1, starts counting at 0) is for RA10.  As for

Pin 18 is the MCLR on the device, reviewing the datasheet you can't even set SDI2 & SDO2 to the above defined numbers.

the PPS is a whole other mess on those chips. Pin 18 is not the 18th pin on the board, but digital IO pin number 18, which is the 19th entry in those pin array tables - RA4.  Mapping RA4 is done through the file packages/chipKIT/hardware/pic32/2.1.0/cores/pic32/pps/pingroups_1xx2xx.h which contains an entry:
#define _PPS_RPA4       (2 + _PPS_SET_C)

and the file packages/chipKIT/hardware/pic32/2.1.0/cores/pic32/pps/peripherals_1xx2xx.h which has:
PPS_IN_SDI2     = (35 + _PPS_SET_C + _PPS_INPUT_BIT),

Those are then used by the mapPps() function to map RA4 to SDI2. Something which is perfectly possible.
Yes, it's convoluted and a bit of a mess, but the best we could come up with given how limited the PIC32MX2xx IO multiplexer is.

84999: <p>I recently got a Microchip Fubarino, contains a PIC32MX250F128D and I'm totally new to the Arduino IDE, i uploaded the blink sketch all fine and well.
Schematic: <a href="https://ww1.microchip.com/downloads/en/DeviceDoc/FubarinoMini_v15_sch.pdf" rel="nofollow noreferrer">FubarinoMini_v15_sch</a></p>
<pre><code>// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
//pinMode(LED_BUILTIN, OUTPUT);


//asm (&quot;BSF PORTA,10&quot;);
//pinMode(RA10, OUTPUT);
//TRISA10 = 0;
TRISAbits.RA10 = 0;
//PORTAbits.RA10 = 1;
//PORTAbits.RA10 = 0; // set to output
//mapPps(20, PPS_OUT_SDO2)
}

// the loop function runs over and over again forever
void loop() {
//digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
PORTAbits.RA10 = 1;
delay(500); // wait for a second
//digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
PORTAbits.RA10 = 0;
delay(500); // wait for a second
} 
</code></pre>
<p>restults in:</p>
<pre><code> Blink:45:12: error: 'volatile union __LATAbits_t' has no member named 'RA10'
LATAbits.RA10 = 0;
</code></pre>
<p>changing:</p>
<pre><code>void loop() {
  //digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  PORTAbits.RA10 = 1;
  delay(500);                       // wait for a second
  //digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  PORTAbits.RA10 = 0;
  delay(500);                       // wait for a second
}
</code></pre>
<p>doesn't work either.</p>
<p>I also tried this example code:
<a href="https://github.com/fubarino/fubarino.github.com/wiki/Fubarino-Mini-pps" rel="nofollow noreferrer">https://github.com/fubarino/fubarino.github.com/wiki/Fubarino-Mini-pps</a><br />
It does work.</p>
<pre><code>#define LED 1
#define SCK2 4
#define SDI2 18
#define SDO2 20 
</code></pre>
<p>The led on the Fubarino board is not connected to pin 1, but to RA10.
Pin 18 is the MCLR on the device, reviewing the datasheet you can't even set SDI2 &amp; SDO2 to the above defined numbers.</p>
<p>Normally on a PIC16F84 or so, you would do something like this.</p>
<pre><code>bank1
movlw b'00000001'
movwf TRISA

movlw b'11110000'
movwf TRISB
bank0 
</code></pre>
<p>the Arduino &quot;code&quot; seems a bit abstract.
I Would like to experiment with the button.<br />
The Chipkit pps example shows you can use the Microchip keywords from the devices datasheet.</p>
<p>Can the Fubarino be setup like a classic PIC device in the Arduino IDE?
Configuring all the pins before going in to loop, using the Keywords from the datasheet.</p>
 4143: <p>The entries in the &quot;bits&quot; structures are named after the bits.</p>
<p>It's not</p>
<pre><code>TRISAbits.RA10
</code></pre>
<p>but</p>
<pre><code>TRISAbits.TRISA10
</code></pre>
<p>The same goes for</p>
<pre><code>LATAbits.LATA10
</code></pre>
<p>The only exception is the &quot;port&quot; one</p>
<pre><code>PORTAbits.RA10
</code></pre>
<p>Which is a hangover from the old PIC16 chips that didn't have a LATx register.</p>
<hr />
<blockquote>
<p>The led on the Fubarino board is not connected to pin 1, but to RA10.</p>
</blockquote>
<p>Pin 1 is RA10. If you look in the file <code>Board_Data.c</code> for the Fubarino_Mini variant (<code>packages/chipKIT/hardware/pic32/2.1.0/variants/Fubarino_Mini/Board_Data.c</code>) you can see all the pin mappings. There's a bunch of arrays there that define how everything fits together.</p>
<p>The second entry in most of those arrays (pin 1, starts counting at 0) is for RA10.  As for</p>
<blockquote>
<p>Pin 18 is the MCLR on the device, reviewing the datasheet you can't even set SDI2 &amp; SDO2 to the above defined numbers.</p>
</blockquote>
<p>the PPS is a whole other mess on those chips. Pin 18 is not the 18th pin on the board, but digital IO pin number 18, which is the 19th entry in those pin array tables - RA4.  Mapping RA4 is done through the file <code>packages/chipKIT/hardware/pic32/2.1.0/cores/pic32/pps/pingroups_1xx2xx.h</code> which contains an entry:</p>
<pre><code>#define _PPS_RPA4       (2 + _PPS_SET_C)
</code></pre>
<p>and the file <code>packages/chipKIT/hardware/pic32/2.1.0/cores/pic32/pps/peripherals_1xx2xx.h</code> which has:</p>
<pre><code>PPS_IN_SDI2     = (35 + _PPS_SET_C + _PPS_INPUT_BIT),
</code></pre>
<p>Those are then used by the mapPps() function to map RA4 to SDI2. Something which is perfectly possible.</p>
<p>Yes, it's convoluted and a bit of a mess, but the best we could come up with given how limited the PIC32MX2xx IO multiplexer is.</p>
