Nano Every use ATmega4808

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

We have design a Nano Every  that use ATmega4808 , it will be easy to develop for updi, and can use as the JTAG to UPDI Programmer.

But I think there will have some bug that we can check out, if you check any problem, please tell us.smiley

Last Edited: Thu. Aug 22, 2019 - 02:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Thinary wrote:
But I think there will have some bug that we can check out,

 

Ok, I'll byte....wheres the bug?

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Now we have test it that if you download some sketch that use Serial1 at tx1 pin too fast will occupy the UPDI communication serial port, than it can not download by jtag2updi.

So now we can only set Serial at D2(PA0) and D3(PA1).

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

The programmer chip is an ATmega328P? You know jtag2updi can fit on a ATmega88PB, saving about 50c of cost? It just needs to be recompiled. Or use an ATmega328PB, which is also much cheaper than the mega328P.

 

Could you post a pic of the backside of the board? You don't have any in your store, there are only frontside pics.

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

El Tangas, I think you should have bite of the Cake $$$ ;)

 

EDIT: typos

Last Edited: Thu. Aug 22, 2019 - 09:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Moe123 wrote:

El Tangas, I think you should have bite of the of the Cake $$$ ;)

 

Lol, no, actually this is all according to plan. I just want cheap mega AVR-0 boards to appear (this one is still too much, about $7). That's why I'm giving free advice to cut costs ;)

 

edit: keep in mind that the ATmega4809 Curiosity Nano has better features (debugger) and is not that much expensive. So this price range is not quite there, yet. It should be <$4.

 

edit2: it just occurred to me: the mega328P can be replaced by a LGT8F328P, thus saving about $1 in costs, while increasing the incorporation of Chinese tech. See? Win-win.

Last Edited: Thu. Aug 22, 2019 - 09:19 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

well, 7$ for a chinese kit is quite a lot also...not to say its bad quality...but...

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

Moe123 wrote:
well, 7$ for a chinese kit is quite a lot also...not to say its bad quality...but...

 

Exactly, needs to be cheaper.

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

@El Tangas,

 

Yes,  it would be nice if the "Nano Every" gets cloned by the Chinese.

 

They just replaced the Atmel USB chip with a CH340 in the traditional Nano.

The ATmega328P bootloader remains the same.

The punter gets exactly the same operational behaviour with genuine or clone Nano.

 

They could replace the SAMD10 with a similar Chinese MCU to give exactly the same operational behaviour

A genuine ATmega4809 is always used.    This would be their main BOM item.

 

I would guess that the Chinese would prefer to use a CH340 instead of the genuine Atmel SAMD10 chip for USB.

This would mean a different Bootloader and different Arduino IDE "board" description i.e. fail as a 100% clone.

 

David.

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

Hi, El Tangas.

This is the back picture.

Because we have invest in time to develop this product, it not use you code to develop because we use other MCU not AVR Series.

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

But it was including the shipping cost.

The shipping cost more than $2.

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

Thanks for the pic. So you managed to place all the components on one side.

 

Thinary wrote:

we use other MCU not AVR Series.

 

Now I'm curious, may I ask which chip you use?

Last Edited: Thu. Aug 22, 2019 - 11:17 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thinary wrote:

We have design a Nano Every  that use ATmega4808

 

and then the OP say they dont use AVR. well, O_o

 

I think thats why people should stay away from these companies....

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

 

No, we are talking about the UPDI interface chip, not the main one. I thought it was a mega328P.

 

 

edit:  It looks like the markings are scrubbed, maybe it's secret, I don't like secrets :(

 

Last Edited: Thu. Aug 22, 2019 - 11:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:

 

 

No, we are talking about the UPDI interface chip, not the main one. I thought it was a mega328P.

 

 

 

Interesting...what should it be ?

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

Moe123 wrote:

Interesting...what should it be ?

 

It can be almost anything, I'm guessing they ported jtag2updi to whatever it is. The minimum requirements are about 8MHz speed (preferably able to execute 1 instruction per clock), 512 bytes RAM and 4KB ROM/flash.

 

I would bet 8051 or ARM core.

 

edit: OK, I'll take a guess -> Nuvoton N76E003AQ20

Last Edited: Thu. Aug 22, 2019 - 12:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't care what USB chip they use.    As long as it gives exactly the same operational behaviour

 

I don't like the idea of scrubbed chips.    They can keep the USB firmware private to their own company.    The 328P Nano clones do not publish the CH340 source code (even if trivial)

 

And yes,   of course the innovative Chinese company deserve to be profitable.

The SAMD10 seems to have the same price as a mega4808.  (which is slightly cheaper than the 4809)

 

David.

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

david.prentice wrote:
I don't care what USB chip they use.    As long as it gives exactly the same operational behaviour

 

I agree. I'm just curious.

 

They are using 2 chips for the interface: a version of the CH340 as USB/serial bridge and a mystery MCU as serial/UPDI bridge.

 

The original Nano Every uses a single interface chip, a SAMD11. The SAMD11 has a USB peripheral, so an external USB/serial chip is not needed. However, since the SAMD11 is a 3.3V chip, it needs level shifters to interface with the mega480X. So in terms of design efficiency I'd say it's a toss.

 

Ideally, you would use a MCU with USB interface, but that runs at 5V (or at least has 5V tolerant pins) and is cheap (< 80 cents).

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

My apologies.   I wrote SAMD10 from memory.   The SAMD11 seems to be a similar cost.

 

Yes,   I am sure that there are several ways to get USB-Serial with 5V tolerance.    And if a Chinese company can produce a cheaper product it seems a good idea (tm).

 

The EVERY has a full 48kB of Flash for user applications.

If it had been a regular AVR + USB-Serial design,   you lose 1kB for an Optiboot-style bootloader.   e.g. ATmega4808 + CH340.

 

As far as I can see,   the mega4809 + SAMD11 design has "UPDI programming" but no "debugging".

 

The world would be a better place if all electronics was 3.3V.

 

David.

 

Edit.  Just ordered one from Thinary (AliExpress).   I will see how well it compares with the genuine EVERY   (that arrived promptly from Italy/Holland)

Last Edited: Thu. Aug 22, 2019 - 02:59 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

 

Edit.  Just ordered one from Thinary.   I will see how well it compares with the genuine EVERY   (that arrived promptly from Italy/Holland)

 

David, Perfect...looking forward for your feedback

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

In an ideal world it will work exactly the same.

In the real world it might take 30 days to arrive.   (if not longer)

 

AliExpress is a mystery.    Recently orders have arrived in 8-9 days.    Others take weeks.   AliExpress pages change to random language even if you Sign In as a known English speaker/country customer.

 

David.

Last Edited: Thu. Aug 22, 2019 - 03:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lately my AliExpress orders have been arriving in about 2 weeks, which I consider good time.

 

Looking forward to your opinions on this clone yes

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

El Tangas wrote:
They are using 2 chips for the interface: a version of the CH340 as USB/serial bridge and a mystery MCU as serial/UPDI bridge.
A USB PIC might be considered, crystal-less (USB SOF), VUSB, auto-baud UART, 16b BRG, though doesn't meet the 0.8USD goal (about twice that) and would have an analog switch (one UART)

PIC18F24K50 - Microcontrollers and Processors

 

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

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

The target price of $0.80 for a single chip comes from this possible 2 chip solution: CH340E (about $0.30 each for 100 quantity) + ATTiny804 (about $0.50 each for 100 quantity).

The usual limiting factor for the MCU is SRAM (at least 512 bytes are needed).

 

Anyway, to avoid messing around with USB programming maybe the 2 chip solution is actually better.

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

The Thinary 4808 EVERY arrived this afternoon.

 

The Megaavr Arduino Core expects a 4809 but the "upload" finds a 4808.

 

So I added an extra section to boards.txt which adds -pATmega4808 to upload.extra_params

##############################################################

nona4808.name=Arduino Nano Every 4808

nona4808.vid.0=0x2341
nona4808.pid.0=0x0058

nona4808.upload.tool=avrdude
nona4808.upload.protocol=jtag2updi
nona4808.upload.maximum_size=49152
nona4808.upload.maximum_data_size=6144
nona4808.upload.speed=115200
nona4808.upload.use_1200bps_touch=true
nona4808.upload.extra_params=-P{serial.port} -pATmega4808

nona4808.build.mcu=atmega4809
nona4808.build.f_cpu=16000000L
nona4808.build.board=AVR_NANO_EVERY
nona4808.build.core=arduino
nona4808.build.variant=nona4809
nona4808.build.text_section_start=.text=0x0
nona4808.build.extra_flags={build.328emulation} -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP
#nona4808.build.extra_flags=-B{runtime.tools.atpack.path}/gcc/dev/{build.mcu}

nona4808.bootloader.tool=avrdude
nona4808.bootloader.file=atmega4809_uart_bl.hex
nona4808.bootloader.SYSCFG0=0xC9
nona4808.bootloader.BOOTEND=0x00
nona4808.bootloader.OSCCFG=0x01
nona4808.fuses.file=fuses_4809.bin

menu.mode=Registers emulation
nona4808.menu.mode.on=ATMEGA328
nona4808.menu.mode.on.build.328emulation=-DAVR_NANO_4809_328MODE
nona4808.menu.mode.off=None (ATMEGA4808)
nona4808.menu.mode.off.build.328emulation=

##############################################################

Sketches obviously build ok since they think it is a 4809

It seems to upload ok via -c jtag2updi as a 4808

 

However the sketch does not run.

 

@El Tangas,

Any ideas?

 

I will try an AS7 project later.

 

David.

 

Edit.   I built a binary for ATmega4809 in AS7.   It will upload via avrdude -c jtag2updi -p ATmega4808.   It does not run after a successful upload and verify.

I built a binary for ATmega4808 in AS7.   It does not run after a successful upload and verify.

I will try tomorrow to debug with ATMEL-ICE and UPDI pin.

Last Edited: Fri. Sep 6, 2019 - 10:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, David.

You can use this Arduino IDE URL to download the ATmega4808 core.

https://raw.githubusercontent.com/Thinary/ThinaryArduino/master/Thinary-boards-index/package_thinary_index.json

You can also download the core at this site:

https://github.com/Thinary/ThinaryArduino/tree/master/Thinary-megaavr

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

david.prentice wrote:

However the sketch does not run.

 

@El Tangas,

Any ideas?

 

 

IDK. If the verify checks out, the program should run, I suppose. But Thinary doesn't use my jtag2updi version, so I can't be sure.

Also, I never tested jtag2updi with the Mega AVR-0 series, a bug is always possible.

 

edit: Ok, I opened the Arduino IDE and loaded the "blink" test sketch on a bare mega4809 (PDIP version), using my current version of jtag2updi (it's not released yet, but the only change is support for LGT8F328P boards). The programmer is a LGT8F328P board. I told the Arduino IDE this setup was a Nano Every.

It's working fine, but it's just a small program, a bigger one might fail especially one bigger than 32kB if there is some numeric bug, we never know...

 

Anyway, the Arduino IDE keeps writing fuses and erasing the whole chip at every upload cycle. I don't know if this is the best option... I wrote jtag2updi to erase only the pages that are written to speed up things and not stress the flash so much, but whatever...

Last Edited: Sat. Sep 7, 2019 - 10:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah-ha.   The 4808 board has completely different pins_arduino.h wiring to the regular EVERY.

 

I altered the wiring macros in my AS7 project to suit.

MCUFRIEND_kbv works very nicely in AS7 (uploading with ATMEL-ICE)

 

Of course the Arduino IDE handles different pins_arduino.h for variants just fine.

 

Serial does NOT work.   And if you attempt to use it,  you are liable to stop Arduino uploads.

 

However it can be recovered with regular AS7 projects and ATMEL-ICE.

 

I think that I will give up with this board for the moment.

 

From Thinary's point of view.   There is little point in a board that does not "clone" the NANO-EVERY seamlessly.

If it works better and is a fraction of the EVERY price punters might ignore the EVERY and go for the Thinary-4808.   Even if it means different Core in the IDE.

 

All the Chinese clone Unos, Nanos, Mega2560s, Dues, ... work very well in the IDE.

It is cheaper for Chinese to use CH340.    The boards sell very cheaply (to Western customers)

 

It is certainly a good idea (tm) to improve the NANO-EVERY.    And of course it should be profitable for them too.

It must be heart breaking to manufacture boards in the cut-throat Nano (328P) market.

 

David.

 

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

Recently, the manufacturer of the classic CH340G has introduced new models that don't need a crystal, the CH330N and CH340E, this means less space and probably less money.

For the UPDI interface, the clones could use a LGT8F328P running jtag2updi (upcoming version).

 

This 2 chip interface solution would cost about $0.50 ($0.25 each chip, TaoBao prices), if we add the cost of the mega4809 that would be a total of $1.50 in silicon. I'm sure the rest would cost less than $1 judging from the other stuff that comes from China. Therefore, manufacturing cost: $2.50.

 

Selling the whole thing (Nano Every drop-in clone) for $4 or so should still turn a reasonable profit, if it becomes very popular.

 

edit: problem is, the Nano Every is already quite cheap at €8, even if the clones cost 1/2 I'm not sure people would go for it.

Last Edited: Sat. Sep 7, 2019 - 01:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
Recently, the manufacturer of the classic CH340G has introduced new models that don't need a crystal, the CH330N and CH340E, this means less space and probably less money.
Likewise by Prolific Technology though couldn't quickly locate a price.

El Tangas wrote:
Therefore, manufacturing cost: $2.50.

 

Selling the whole thing (Nano Every drop-in clone) for $4 or so should still turn a reasonable profit, if it becomes very popular.

3 to 4 times the cost though that's a US-centric guideline.

 


Prolific Technology | USB to UART/Serial/Printer

NEW! USB to UART G Series Archives | Prolific USA | IC Design & Manufacturing

 

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

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

gchapman wrote:

3 to 4 times the cost though that's a US-centric guideline.

 

Yeah, there's no way they follow that rule in China.

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

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

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

The Nano Every apparently implements the USART bridge like this (I'm speculating since I don't own one, just observing what the IDE does):

 

Normally, the SAMD11 acts as a USB/serial bridge connected to the USART0 of the Mega4809. Before programming starts, the IDE sends a DTR pulse of 20 seconds (why so long?), that the SAMD11 interprets as a signal to enter programming mode, that is, instead of USB/USART0 bride, it becomes a USB/UPDI bridge.

 

I think I should try to implement this behaviour in future versions of jtag2updi.

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

El Tangas wrote:
... the IDE sends a DTR pulse of 20 seconds (why so long?)

 

It seems that the 20 seconds isn't required.

 

  From david.prentice (Link):

Woo-Hoo.   I have cracked it:

mode %COMPORT% baud=12 dtr=on > nul
mode %COMPORT% baud=12 dtr=off > nul

Could it be that the DTR is asserted for the duration of the download?

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

Actually,  manufacturing cost is $3.2, and $2.5 is shipping cost, and $0.5 is give for aliexpress. we only get $0.99 for it.

If we don't choose Registration packet shipping, it can do be $4.99.

Like this:

https://www.aliexpress.com/item/4000160961890.html

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

Go on.   You sell regular 328P Nanos for £1.50 each in lots of 10.    It is a cut-throat market.

Your NANO-328P has components on both sides of pcb.    Your EVERY-4808 has components on one side.  

A similar number of similar components.    The 4808 may cost you more than 328P.

 

Personally,   I think it is important that Chinese manufacturers should make a good profit.

Manufacturers and their agents can arrange economic delivery.

 

Yes.   The EVERY-4808 arrived safely in 15 days in a plastic box.   Ordered 22 August.  Received 6 September.

 

The plastic box was unnecessary for a small pcb.   The padded envelope was sufficient.

 

OTOH,   shops that mail delicate TFT or LCD screens in plastic envelopes without any protection are unwise.    They just get broken glass screens and unhappy customers.    My apologies:  YOUR packing is excellent.

 

The "bootloader" works fine until you upload a sketch with Serial class.    Subsequent uploads fail.

Unfortunately most of my programs use the Serial class.    After all,  that is the whole point of a USB-Serial connection.

 

I possess an ATMEL-ICE but not all customers expect to use an external programmer.

I added this to programmers.txt

atmel_ice.name=Atmel-ICE (UPDI)
atmel_ice.communication=usb
atmel_ice.protocol=atmelice_updi
atmel_ice.program.protocol=atmelice_updi
atmel_ice.program.tool=avrdude
atmel_ice.program.extra_params=-Pusb

This lets me upload sketches via the UPDI pin.   And means that I can recover the "bootloader" by using the ATMEL-ICE to upload a non-Serial sketch e.g. Blinky.

 

The regular NANO-EVERY can use Serial painlessly.     The UPDI pad is not accessible from the top of the pcb.   

At least your EVERY-4808 can access UPDI from a header pin.   (otherwise the board is rendered useless after the first upload)

 

It is quite nice that you get the whole 49152 bytes of Flash for applications.

But the design would have been a lot simpler with 512 byte bootloader and 48640 bytes of application.   e.g. like NANO-328P has ATmega328P + CH340

 

Yes,  I am sure there is a market for a ATmega4808 + CH340 board.

The regular Arduino design of MCU + USB-Serial chip means that the Serial is always available.    (however the user mistreats the MCU)

 

David.

Last Edited: Sun. Sep 8, 2019 - 01:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thinary wrote:
Actually,  manufacturing cost is $3.2, and $2.5 is shipping cost, and $0.5 is give for aliexpress. we only get $0.99 for it.

 

Thanks for the info. The manufacturing cost is a bit higher than my estimate.

 

david.prentice wrote:

Go on.   You sell regular 328P Nanos for £1.50 each in lots of 10.    It is a cut-throat market.

Your NANO-328P has components on both sides of pcb.    Your EVERY-4808 has components on one side.  

A similar number of similar components.    The 4808 may cost you more than 328P.

 

Yeah, the manufacturing cost of the Thinary board at least makes sense. But this for example: https://www.aliexpress.com/item/...

A LGT nano clone for $1.30 incl. delivery, how can it be possible?

Last Edited: Sun. Sep 8, 2019 - 02:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would take his figures with a pinch of salt.

 

Of course the manufacturing cost is high for small runs.

If the product is successful they would be making 1000s.    Look at Nano-328 or BluePill-STM32F103

 

Likewise,   AliExpress will have different rates.

 

But the 'suspect' figure is shipping.    It costs the same to mail 10 boards as 1 board.    Or even 100 boards.

There is little point in tracked shipping for low value packets.

 

I don't know about Portugal.    But in the UK there are many "online shops" that claim to have UK warehouses.

In fact they probably import the items "just in time" with regular fast delivery from China.

The Ebay customer pays more less than for genuine UK stock but gets her packet faster than the "free postage" Chinese shop (8-58 days to UK).

 

I wish Thinary success.    After all,  they have designed the schematic, pcb and written the custom Arduino Core software.

 

David.

Last Edited: Sun. Sep 8, 2019 - 03:59 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
I don't know about Portugal.    But in the UK there are many "online shops" that claim to have UK warehouses.

 

No such things around here, probably the size of the market doesn't justify it. Normally I buy "big ticket" items (well, actually anything over €20) from such warehouses, usually located in the UK, Germany or Italy.

For me the main advantage is that those sellers take care of customs taxes and VAT, I don't care how, it's their problem. What matters is that I buy from an EU store so that customs don't bother me.

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

Their BOM is more cheap than us, and if we packet only the paper bag, it will cost the less shipping.

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

You need to use our core file, because we change the Serial port to D2, D3.