Simplest toolchain / programmer setup for *smallest* development board?

Go To Last Post
37 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Long time no post - I haven't used an AVR in about 5 years...  So help me get back into it.

 

I'm trying to find the minimal toolchain to support development with the smallest card possible - would prefer an 8-bit AVR, need at least a few GPIO and a UART in addition to whatever interface programs it (bootloader or ISP).  I used to use Eclipse / AVR-gcc / AVRDude, but recall setup and maintenance issues...

 

I'm looking for the simplest toolchain setup that will let me use something like the DFR0282 or DFR0339.  Those have Arduino bootloaders - but I hate Arduino and will do anything to avoid using it.  I really don't want this thread to devolve into a debate about the merits or detriments of arduino - so please just deal with it.

 

I'm open to using slightly larger hardware, and have been trying to load the dev kit pages at Microchip's site all morning - but can't.  I know Atmel Studio and Atmel programmer kits will directly support their cards / kits - so suspect that's the easiest path.

 

So - outside of getting Atmel Studio to work with an arduino bootloader, is there an Amtel Studio supported nano / ATtiny / similar board that works directly with Atmel Studio?

 

Thanks a lot!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well the "simplest" toolchain is surely a stand-alone assembler such as Atmel's Asm2 or perhaps even more so "avra" ?

 

Also say what you actually mean by "smallest". Do you mean the entire PCB must be the smallest thing possible? Or the AVR with fewest I/O pins? Or the AVR with the very smallest physical package size? Or the smallest flash/RAm combo or what?

 

What is the driving design goal that requires "small"? As you probably remember some of the larger devices (esp mega versus tiny) are actually "easier" to develop with because they don't have crumby things lie USI but have real UART, SPI, I2C and so on.

 

As for toolchain, if you mean C and specifically avr-gcc then the easy option is just "Atmel Toolchain for XXX" (XXX = Windows or Linux) that Atmel themselves put together. It generally supports a wider range of AVR devices than builds of avr-gcc from other sources.

 

Of course avr-gcc requires some work to "set up". That is not everyone's cup of tea. A pre-configured package like Codevision may be an easier option.

 

(and I didn't mention Arduino even once)

 

But if your goal is to avoid Arudino (though the hardware is excellent even if you only plan to use C or Asm or BASIC etc) then a good option to look at are the Xplained boards from Atmel. Some even have a debugger built in for small $'s.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Surely, Atmel Studio can work with a bootloader - Arduino or otherwise.

 

And there's nothing magic or special about Arduino hardware; it's just a board with a microcontroller on it - you can program it with ICE/ISP as normal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For quick prototyping hardware, I have used Arduinos, Teensys (various uCs), Xplained Minis and Xplained Pros; however, all software development using Atmel Studio...

(if Atmel devices wink)

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For mere mortals, an 8-pin AVR8 is the Tiny25 family, right?  And that gives you 5 I/O total.  But you mentioned "UART", so that takes 2 pins right away.  And for reliable UART operations you need a good clock -- how will that be provided?  That steals one or two pins.  Not much left for app purposes.

 

There are Arduino boards based on the Tiny85; e.g. https://www.itead.cc/iteaduino-t... I have no idea how the USB interface works on that, or how you would try to do USART.

 

Not the absolute smallest pin count, but the Tiny1634 has a lot of resources for a Tiny, including twin USART and provisions for a crystal.

 

Also look at the new "XTiny" models, '817 family.  They come in several small packages if you are into QFN, and 14-pin SOIC for the '814.

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for helping - the driver is physical size.  i only need a working UART and GPIO.

 

what i mean by toolchain - the complete package of software needed to go from C / C++ to a programmed board.  i'm not an admin on my machine at the office, and need to submit requests for each installation.  i'll have to document the setup so it can be reproduced, etc - the simpler the software package, the better.  So Atmel Studio would be great - it'll include drivers, libraries, etc.

 

my preference would be for an eclipse bundle with avr-gcc and avr-dude built in...  i haven't found an all-in-one solution like that, which is why i'm poking around the forums...

 

the alternative would be a beetle-like board from microchip, that is supported by atmel studio.  haven't found that either.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

understood - i'm looking for simple setup - see my previous response for clarification.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pwhitt wrote:
the driver is physical size

See: http://www.avrfreaks.net/forum/m...

 

Quote:
a beetle-like board from microchip, that is supported by atmel studio

What do you mean by, "supported".

 

The only "support" that is specific to a board would be any ready-to-go examples provided.

 

But the tools themselves are oblivious of the board - they know only the CPU.

 

pwhitt wrote:
i'm looking for simple setup

Atmel Studio, then.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pwhitt wrote:
the driver is physical size.
Again "board" or "device". Are you looking for a ready made dev board that is "small" and that hopefully integrates well with Studio or are you looking for a very small package AVR to lay down on your own very small PCB design?

If it's small dev boards then I hate to say it but the "Nano"s are a very common choice. They do come under the "A-word" category though surprise

 

However, as already suggested, just because the HARDWARE is Arduino it does not mean the SOFTWARE has to be. The only bit you will likely retain from "Arduino" is a copy of avrdude for putting software into the board.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for pointer!

 

by "supported" - i mean a board with a dedicated ISP connector that i can plug into an off-the-shelf atmel programmer and use with atmel studio.

 

i know that's a low bar, but some of the smallest arduino boards i've seen don't have the ISP pins run to headers.  i also recall the "newer" chips having dual purpose ISP / USB peripherals so maybe it's there and i don't recognize it...  i want to avoid anything that isn't an immediate drop in and burn solution.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If it were me, I'd first concentrate on your primary listed criteria:

1)  Microcontroller model selection, with enough pins for the app.  Don't forget to consider "clock" if using UART.

2)  Target size of the small final board.

 

>>Then<< start your search for already-crawling beetles...

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pwhitt wrote:
some of the smallest arduino boards i've seen don't have the ISP pins run to headers. 

Some boards (not just Arduino) just have pads (tespoints) - so you use "pogo pins" for programming:

Image result for isp programming pads

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
just because the HARDWARE is Arduino it does not mean the SOFTWARE has to be

See: https://www.element14.com/community/roadTestReviews/1453/l/review-of-arduino-due (which happens to be ARM - but the same principle applies)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You only have to wire up 6 pins to get ISP for your programmer:  MISO, MOSI, SCLK, Vcc, gnd, and reset.  Then use whatever IDE you like.  I use Atmel Studio exclusively.  I also use a lot of Chinese Arduino Nano's for less than $2 each.  Some have issues with USB or the voltage regulator, so buy a couple in case you get a lemon.  They have the 6-pin header for programming and a USB connector for UART that just works when you plug it in, a 16MHz crystal/resonator, a reset button, and an LED.  They are pretty small, and are a drop in solution.  If you want smaller, you will pretty much have to build your own board.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pwhitt wrote:

I'm trying to find the minimal toolchain to support development with the smallest card possible - would prefer an 8-bit AVR, need at least a few GPIO and a UART in addition to whatever interface programs it (bootloader or ISP).  I used to use Eclipse / AVR-gcc / AVRDude, but recall setup and maintenance issues...

 

So - outside of getting Atmel Studio to work with an arduino bootloader, is there an Amtel Studio supported nano / ATtiny / similar board that works directly with Atmel Studio?

 

Sure, look at the XMinis, and if you are at the lower AVR end, look at the new 'XTinys' Tiny817/1617/3217 series.

 

pwhitt wrote:

by "supported" - i mean a board with a dedicated ISP connector that i can plug into an off-the-shelf atmel programmer and use with atmel studio.

If you install AVR Studio, then you are good to go with an XMini.

Your initial wording made it sound like you wanted the smallest software footprint, but whilst Studio is not small, it is simpler to install as it is certainly 'a well traveled path' :)

 

Search ATTINY817-XMINI

 

Someone may know how far off the ATtiny1617, ATtiny3217 series Eval boards are ?

 

Looks like ATtiny1617 parts are in stock, so maybe a reworked ATTINY817-XMINI to swap in a ATtiny1617 can make do ?  Anyone tried that  ?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
There are Arduino boards based on the Tiny85; ... I have no idea how the USB interface works on that, ...
Micronucleus; it's derived from V-USB.

theusch wrote:
Also look at the new "XTiny" models, '817 family.  They come in several small packages if you are into QFN, and 14-pin SOIC for the '814.
Likewise for the 16KB tinyAVR 1-series (QFP, narrow SOIC, wide SOIC) (tiny1617, tiny1614, tiny1616)

https://www.microchip.com/pressreleasepage/new-tinyavr-mcus-1617

 


V-USB - A Firmware-Only USB Driver for Atmel AVR Microcontrollers

https://www.obdev.at/products/vusb/index.html

GitHub

ATTiny usb bootloader with a strong emphasis on bootloader compactness.

https://github.com/micronucleus/micronucleus

via http://docs.platformio.org/en/latest/platforms/atmelavr.html#packages

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pwhitt wrote:
i'm not an admin on my machine at the office, and need to submit requests for each installation. ... So Atmel Studio would be great - it'll include drivers, libraries, etc.
Likewise for IAR EWAVR and its code generator may rank as the best.

Could evaluate IAR EWAVR by the zero price Kickstart version (4KB of code) on a tiny416 Xplained Nano.

pwhitt wrote:
my preference would be for an eclipse bundle with avr-gcc and avr-dude built in...  i haven't found an all-in-one solution like that, ...
PlatformIO has the AVR GCC toolchain with AVRDUDE; there's dox for the Eclipse integration.

IIRC, there's some posts here where ones have had success with the Eclipse AVR plugin.

PlatformIO has paid support for small operators on up to enterprises.

PIO Unified Debugger does not yet have AVR though PlatformIO's creator is in discussions with ones at Microchip.

 


IAR Benchmark results for AVR

https://www.iar.com/iar-embedded-workbench/tools-for-avr/benchmark-results-for-avr/

https://www.iar.com/iar-embedded-workbench/?focus=wbselector#!?device=ATtiny416&architecture=AVR ("Download a free trial!")

http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=ATTINY416-XNANO

http://platformio.org/platforms/atmelavr

http://docs.platformio.org/en/latest/ide/eclipse.html

http://www.avrfreaks.net/forum/avr-source-level-debugging-eclipse-winxp-dragon-%E2%80%93-success-0

http://platformio.org/pricing

http://docs.platformio.org/en/latest/plus/debugging.html

http://www.avrfreaks.net/forum/platformio-do-or-do-not-thats-question#comment-2267111

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MarkThomas wrote:
You only have to wire up 6 pins to get ISP for your programmer:  MISO, MOSI, SCLK, Vcc, gnd, and reset.
(to go further)

  • 2 pins for debugWIRE (after ISP to enable debugWIRE) (GND, dW/RESET)
  • 4 pins for XMEGA PDI (GND, Vcc, PDI data, PDI clock)
  • 3 pins for tinyAVR 1-series UPDI (GND, Vcc, UPDI)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:
Looks like ATtiny1617 parts are in stock, so maybe a reworked ATTINY817-XMINI to swap in a ATtiny1617 can make do ?
Is each instance of mEDBG specific?

(iow only for the MCU on that board?)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

Who-me wrote:
Looks like ATtiny1617 parts are in stock, so maybe a reworked ATTINY817-XMINI to swap in a ATtiny1617 can make do ?
Is each instance of mEDBG specific?

(iow only for the MCU on that board?)

 

That's the key question :)

Certainly mEDBG will be quite family specific, but the hope here is that the tiny1617 is a small enough sibling increment, to be within a single 'support envelope'

( & maybe also the Tiny3217, but I can't find the package choices for that )

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I program the Chinese Nano's with an AVRISP mkII or an ICE with Atmel Studio by plugging into the 6-pin header on the Nano.  Easy Peasy.  The UART code I write comes out in PuTTY on my laptop by plugging a USB cable into the Nano and my laptop and getting the correct port from the device manager in Windows.  Easy Peasy.  The Nano is 1.7"x0.7".  Is that what you are looking for, or is it too big?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MarkThomas wrote:
Is that what you are looking for,

Note the UART requirement...

 

Again:

1)  What are the requirements for the AVR model?

2)  What are the requirements for board size?

 

IMO, until you settle on that, discussion of toolchain and IDE and dev platform and ISP method/mechanism are moot.  I suppose one >>could<< make the latter a primary criterion.  But I'd rather do the "good stuff" first.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess I should say the Nano has an ATmega328P, so you get all that implies. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IIRC, there's more than one mega328PB small board by third parties.

 

http://www.watterott.com/en/Wattuino-pro-mini-PB-5V-16MHz

http://www.watterott.com/en/Wattuino-pro-mini-PB-3V3-8MHz

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a bunch of ProMini's I bought for a friend who never took them.  They are a little shorter than a Nano and a little wider.  They dont have the 6-pin programming header and no USB connector.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:
Someone may know how far off the ATtiny1617, ATtiny3217 series Eval boards are ?
One for tiny1617 :

Microchip Technology Inc

Microchip

Secure AVR BLE IoT Node

http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATAVRBLE-IOT

via http://www.microchip.com/wwwproducts/en/attiny1617

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Haven't heard much from the OP for a while.  I wonder if we scared him away, or if he was phishing for something else.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

Who-me wrote:
Someone may know how far off the ATtiny1617, ATtiny3217 series Eval boards are ?

 

via http://www.microchip.com/wwwproducts/en/attiny1617

 

That link mentions the xMini Tiny817, under Development tools, but does not say if that means you can swap in a Tiny1617 to get proper emulation, or if they mean you can test half your code at a time ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MarkThomas wrote:

Haven't heard much from the OP for a while.  I wonder if we scared him away, or if he was phishing for something else.

 

Maybe he's waiting on corporate approval to download Atmel Studio... ;)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uuuhhh.  sorry for being quiet for an afternoon, i work for a living.

 

i'm just going to grab a couple variants of 3rd part boards with ISP headers, use atmel studio for now, and blow-out the arduino bootloader.

 

in the end, i suspect i'll put together another eclipse installation with avr-gcc - provided it hasn't gotten as bloated as atmel studio.  otherwise, notpad++ and makefiles.

Last Edited: Wed. Oct 18, 2017 - 11:48 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, I completely missed the reference to:

pwhitt wrote:
something like the DFR0282 or DFR0339

in post #1. So you mean something like:

 

or

?

 

In that case I'd simply put it out o your head that anyone ever called these "Arduino". Then you can use them anyway.

 

The only connection to Arduino you need be concerned about is the fact that they are going to be programmed across USB in "the arduino way" (which basically just means using avrdude.exe on the PC).

 

Nothing says that the code you put in them has to have anything to do with Arduino.

 

Just use the fact that they are delivering the "small hardware" you are looking for. You can write "bare metal" programs and the only faint whiff of Arduino is that once you have created a .hex file to put into one you will use about 0.01% of an Arduino installation (the copy of avrdude.exe) to put the .hex you built into them.

 

It's pretty easy to set up avrdude.exe "inside" Studio 7 so you build your programs there and press a toolbar or menu entry to say "burn to board" and it just so happens that it invokes avrdude.exe to have a conversation over USB with the bootloader code that is in the board to achieve that programming. But that's as close to arduino as you ever need to get.

 

BTW another link that might be useful for this: http://www.instructables.com/id/...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
So you mean something like:

Overkill for OP's app, probably, but for the size and capabilities $15/qty. 1 ain't bad -- dev done.

 

clawson wrote:
In that case I'd simply put it out o your head that anyone ever called these "Arduino". Then you can use them anyway.

Perhaps.  The bootloader will be special to that board and not the standard Arduino bootloader.  [right?]  And are the ISP pins brought out?

 

https://www.dfrobot.com/wiki/ind...

Yes, the ISP pins are brought out so I'll agree with Cliff at first glance.

 

If those are 0.1" through-holes, then the board is about 15mm x 15mm? [why is there no size given on that page, when advertised as "smallest"?

 

Aah, now I see the "regular"/non-Bluetooth Beetle.  More bare bones and only 8 bucks.  If that doesn't fit OP's bill I'll eat my duck food.

https://www.dfrobot.com/product-... 20x22mm

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
Overkill for OP's app, probably,
They are the "DFR0282 or DFR0339" he mentioned in #1 in fact - so OP had already found these when he started the thread. I have a feeling his concern was simply that, being "Arduino boards" the implication was that the only way to develop for them would be using the Arduino IDE. If he's been out of AVRs for 5+ years he may not realise that what many of us do IS to buy Arduino boards then program them in other ways (because they are quality boards made cheap). So if I was him I'd stop looking and start buying.

 

BTW if anyone can be bothered there may be some merit in wading through all of Atmel's previous twitter feed. These days it has been renamed "@MicrochipMakes" about once a month it seems to post about "the smallest AVR board ever made" which is beaten in every subsequent month. Many of the boards they post about are "Arduino"s in fact. Their feed is here:

 

https://twitter.com/MicrochipMakes

 

(not sure if you have to be a logged in Twitter user to see that or not?)

 

Just a few of the recent "small things" they have shown on their feed (be warned these aren't all AVR):

 

https://twitter.com/JoshLuben/st...

https://twitter.com/MicrochipMak...

https://twitter.com/MicrochipMak...

https://twitter.com/oshpark/stat...

https://twitter.com/MicrochipMak...

 

(those are just some from October - probably worth trawling back a lot further)

 

In this last month it seems to be "LilyPads" that look most interesting:

 

https://www.sparkfun.com/product...

 

LilyPad Arduino 328 Main Board

Last Edited: Wed. Oct 18, 2017 - 02:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

pwhitt wrote:

...

I'm trying to find the minimal toolchain to support development with the smallest card possible - would prefer an 8-bit AVR, need at least a few GPIO and a UART in addition to whatever interface programs it (bootloader or ISP).  I used to use Eclipse / AVR-gcc / AVRDude, but recall setup and maintenance issues...

 

I'm looking for the simplest toolchain setup that will let me use something like the DFR0282 or DFR0339.  Those have Arduino bootloaders - but I hate Arduino and will do anything to avoid using it.  I really don't want this thread to devolve into a debate about the merits or detriments of arduino - so please just deal with it.

...

 

Now, back to toolchain as we seem to have come full-circle on "dev boards".

 

To OP:  Sorry, we MUST come back to your inborn hatreds in this case.  As Cliff said, just because the board has "ino" silk-screened somewhere doesn't mean you have to write Arduino sketches and use that environment.

 

[I'm not an Arduino person, but from discussions here one could go "half way" and blow away Arduino config in init() and use loop() for main loop code.  But personally I'd tend to agree with you  -- if you ain't gonna be Arduino then start with a clean slate.]

 

OK, so now we aren't going to write sketches.  One could still go "part way", at least a small step, and leave the well-proven bootloader in place.  If you are a bootloader kind of person, that would certainly have attraction -- you now have your Beetle, and probably ready to plug into your PC's USB port.  REady to start app programming Day 1.

 

If you aren't a bootloader person, then you get a couple Chinese clone USBASP delivered to your door for a couple bucks each.  Adapt to the Beetle ISP pinout.

 

Another choice, depending on your upbringing and religious preferences -- one >>might<< want to use an ICE for debugging.  There are new flavours floating abo0ut but you can probably get an ICE that does debugWire and also programs your device for about 50 bucks.  Your choice...

 

Now, if I were to get an Atmel ICE then I'd also use Studio to drive it.  That is indeed a big step from "minimal toolchain".  Comes back to your decision about the importance of the ICE.

 

Minimal toolchain?  AFAIK Atmel assembler 2 requires nothing but AVRASM2.EXE.  I don't know if it is anything other than Windows.  And you did not mention whether Windows also offends your sensibilities or moral tenets, like the A-word does.

[side note:  If it were me and only using AVRASM2, I'd like access to the chip-include files.  Another step towards Studio but you can pick them up elsewhere.]

 

So now we have

[your favourite text editor] => AVRASM2 => .HEX/.EEP => [empty box] => USBASP => Beetle

 

$8 for the Beetle plus shipping plus $2 for the USBASP.  Ten buck investment.

 

Still an [empty box].  I'm a dude, but don't really have much experience with AVRDUDE.  That said there have been lots of mentions here.  The Beetle thingy has a mature AVR model, and The Dude should have no problems with a USBASP.

 

Pretty minimal.  $0 toolchain cost.  Fits your bill?

 

If the application is really going to be very minimal, and you want to program in C, then e.g. CodeVisionAVR trial edition goes up to 4KB of program size and has built-in ISP programmer.  And a half-decent IDE.  Trial versions of other toolchains may be similar.

 

Beyond that, Studio7 isn't minimal but covers all of the above, and needs no license for large programs.  There are people here that have had conflicts/problems with a PC that has .NET installed.  I personally haven't run into that.

 

 

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
I'm not an Arduino person,
theusch wrote:
config in init()
Which just proves the point cheeky

 

It's called setup() not init() ;-)

 

BTW a little (well perhaps not that little) known fact about Arduino is that the main() they supply is a "weak" version so apparently you, the user can implement a main() rather than setup()/loop() in a "sketch" and it will over-ride the whole Arduino infrastructure - at power on the CRT from the compiler will simply call direct to the main() you provided.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the main() they supply is a "weak"

I had a look at the latest and newest version of the main: https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/main.cpp

It does not seem to be declared as __weak__ (maybe github's characters have become too tiny and my eyes are very weak)

 

The Editor of Hackable Magazine, two years ago, hinted main could be redifined (-> was a weak one if I understand, but it was with energeia IIRC )

I bet it once existed and this nice feature disappeared.

 

Solution, if one wants to use plain cc with arduino IDE,  is either

 

(a) to put one's main into setup() and pray nothing has been initialized in contradiction with what one wants.... (arduino's inits come before one's setup)

 

(b) to be like OP and hate/shun  Arduino

 

(c) hope I made a mistake

Last Edited: Wed. Oct 18, 2017 - 05:18 PM