Features Feedback (WIBLI features list)

I generally love the new IDE 2 compared to IDE 1.8.16 but there are still some things it could do better. This is meant to be positive criticism and I would really like to adopt it for use all the time. BUT...

I really want to use a feature rich IDE which makes compiling and uploading easy as I am not a programmer, more a builder of stuff that need MCUs
these days.

The big positive thing about Arduino is how it seamlessly manages the external libraries that come with some of the shields and there's loads of material out there on the WWW.

I have been frustrated with Microchip Studio 7 as although it has an Arduino sketch import wizard, this fails to cater for any but the basic libraries.

I read forum posts on the subject, folk always question why someone would want to move away from the Arduino IDE especially if you want to use external libraries (eg RadioHead).

Here's my current list of reasons - features of Microchip Studio 7 I like above Arduino IDE 2.0:

  • IntelliSense - type eg a 'D' on a new line and you get a drop down of all probable words you might be thinking of writing eg 'DDRB' in my case.
  • Editor syntax checking pre compile - there's a red squigggly line under anything it can't reference.
  • Spell check on comments.
  • Can shrink loops and /.../ structures.
  • Can rename variables and change all instances if required
  • Tab control is more intuitive
  • Can access web links direct from comments (for spec sheets - supporting documentation)
  • Colour coded register names
  • IntelliSense helps correct variable scope error before compile
  • Highlight a variable and all instances of that are highlighted.
    There's a bunch more features I haven't learnt to use yet.

These features make using it so much easier to edit code despite having to:

  • solder an ISP header to my Nano
  • connect it the right way round to my ISP
  • use a Pololu ISP (emulates a STK500 ISP) - it comes with instructions how to use with Studio 7
  • open up a PuTTY screen to view Nano onboard USB serial port

I'll write all the port control, WDT, Timer and PWM stuff and ISR to get my buttons and switches to fly. Finally I will use Arduino IDE to spin up the external libraries that Studio 7 failed to import (I also tried adding these manually but failed) and Upload sketch for some Arduino IDE based tweaks.

But what I'd really like to do is use the Arduino IDE for the whole process.

Thanks so much for your valuable feedback @petercj!

Arduino IDE 2.x has it (it is called "Editor Quick Suggestions"). You need to enable it in File > Preferences.

Or if you are like me and don't like distracting things popping up constantly while writing code, leave it off and just trigger the suggestions on demand with the configurable "Trigger Suggest" keyboard shortcut (defaults to Ctrl+Space).

Arduino IDE 2.x has it.

There are some known issues and limitations with the Arduino Language Server which provides these capabilities. Those are tracked here:

https://github.com/arduino/arduino-ide/issues?q=is%3Aopen+is%3Aissue+label%3A"topic%3A+language+server"+label%3A"type%3A+imperfection"

The Arduino Language Server is under active development. I think the next build of Arduino IDE 2.x will have fixes for several of those issues.

I have installed the "Code Spell Checker" extension in VS Code to get this capability and I do find it useful.

However, even though it is designed to avoid them as much as possible, by the very nature of writing about code, I frequently get false positives. I think those could make the IDE less friendly to beginners, so I would not be in favor of such a thing being on by default.

I would be satisfied with adding additional capabilities to the IDE myself, just as I do with VS Code:

Both the classic Arduino IDE and Arduino IDE 2.x have such a folding capability already. Unfortunately, the method used for folding by Arduino IDE 2.x is not very sophisticated (just the same as a stock VS Code install):

I believe this is planned eventually (there is a "Rename Symbol" in the context menu), but I don't think it is working at this time.

We would need some specific suggestions for making it more intuitive.

Both the classic Arduino IDE and Arduino IDE 2.x have this capability already.

The classic Arduino IDE has a capability for custom control of syntax highlighting. Nothing like that has been implemented in Arduino IDE 2.x yet. The old keywords system was somewhat crude and frequently not used correctly by 3rd party library authors so it would be great if it could be provided automatically by the language server rather than configured manually by the IDE, boards platform, and library developers as has been the previous practice.

I would guess Arduino IDE 2.x does it just as well. If not, please provide a detailed set of instructions we can follow to reproduce the issue.

Arduino IDE 2.x has it.

Many thanks @ptillisch
I'll have another go with the Arduino IDE.
I spent the day in Studio 7 building up an initially imported sketch from Arduino into Studio 7.
I started organising the ports I wanted to use (defining outputs, setting input pull ups high etc). Things were going swimmingly then the previously tested WDT code started misbehaving - I thought I'd set up WDT interrupt but code kept restarting just after ISR WDT_vect code started, like a reset was going on as if I had set WDE as well as WDIE. I was sure my WDTON fuse had not been programmed (set to 0) - Long story, short - you guessed it. I bricked my Nano by setting the WDTON fuse - can't talk to it using the bootloader via serial port from Arduino, can't use ISP via Studio 7. Well there's a learning point there.

Replaced Nano - the WDT is still refusing to behave and now the code in the void setup() construct is playing up. I have a hunch Studio7 has become unstable - perhaps it needs to have its

int main(void){
     while(1){ 
     } 
} 

structure.

I'm sort of stuck between the bit mangling I like to do with Studio 7 and the Arduino presentation.

I might be trying to use GPIO pins of the ATMEGA328P that are tied up with the onboard hardware of the Nano. I'm going to crawl away for a while and rethink stuff. I need 6 digital output pins and 4 digital input pins.

Time passes and inexplicably my WDT code works OK now with this WDT code:


void enableWDT(void){							// turn on WDT with 4s prescaler set
	// Watch Dog Timer info
	/*
	// Prescaler values for WDT
	// WDP3 WDP2	WDP1	WDP0	Time out  page 49 of spec sheet
	// 0	1		1		1		2s	
	// 1	0		0		0		4s <<  - going for this one
	// 1	0		0		1		8s  

	//  WDTON WDE WDIE
	//  1*    0   1                         Interrupt mode (*Assumes fuse WDTON has not been blown) // page 48
	*/
	char oldSREG = SREG;						// store SREG state specially for global interrupt enable
	noInterrupts();								// disable interrupts
	wdt_reset();								// reset watchdog - don't want it timing out mid change
	MCUSR &= ~(1<<WDRF);						// clear the WDT restarted flag
	WDTCSR |= ((1<<WDCE)|(1<<WDE));				// start timed sequence enabling it to be edited - page 44- 46 WDE clear
	WDTCSR = ((1<<WDIE)|(1<<WDP3)|(0<<WDP2)|(0<<WDP1)|(0<<WDP0));
	SREG = oldSREG;								// restore SREG (will also re-enable interrupts if they were enabled before)
}

The only tweak I made as clearing the WDT restarted flag - maybe that was the issue?

Anyway, thanks again for the pointers to the features in ArduinoIDE2 - I like the IntelliSense but I think Studio 7 currently still has the edge but maybe not for long as IDE2.0 develops.

I'm off to get my switch interrupts debounced now....

I have a relay (luckily driven by a UDN2981A) driven by D11 - doh! which is also MOSI. It nearly shredded itself when I hooked up all the hardware. The other relay is on D10 - SS.
I'll have to hunt around for another port - maybe swap the switches around - or better, find a driver with an enable that is HIGH so when the ISP starts programming and holds Reset LOW, the driver will be isolated. Ho Mum