Forbiden tech from China has arrived :-)

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

That's right, I ordered a board with the infamous AVR clones from Logic Green. It's an Ocrobot Alpha with the  LGT8F328P MCU. The board itself is pretty crappy, no crystal, uses an internal 32MHz oscillator divided by 2 (16MHz).

So it's kind of an Arduino clone, comes with the optiboot bootloader. But is this MCU a piece of crap, or should Microchip be worried and start preemptive lawsuits? I will test it and find out.

 

 

The markings on the MCU have been erased, but I did a memory dump (the flash is mapped as a RAM address, like the new Tiny models) and it checks out.

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

 

El Tangas wrote:
the infamous AVR clones from Logic Green

Are you referring to this: http://www.avrfreaks.net/forum/a... ?

 

The http://www.mcugreen.com/?page_id=5074 link in that post seems to be dead.

 

Bug google suggests this: http://www.electrodragon.com/w/Arduino_LGT

 

Datasheet (Chinese): http://www.electrodragon.com/w/images/4/47/Lgt8fx8p_databook_v1.0.1.pdf

 

 

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

Yes, it has the same chip, but what I bought is this. It was not easy to find.

 

Edit: There is also a forum (in Chinese, like the datasheet sad fortunately there is google translate).

Last Edited: Wed. Aug 9, 2017 - 03:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The most interesting feature of this MCU seems to be the uDSC, which is a math coprocessor. It has a 32 bit accumulator, 2 16 bit registers and can do 16 bit DMA to/from the SRAM. It will take me quite a while to figure it out.

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

Hello,

  Do you have to load a driver for Windows in order to use this new USB-serial IC?   For the Nano, one must download and install the CH341 driver.  Also, with Windows10, I had to disable the "driver signature verification", a weird, paranoid, poorly documented, cumbersome process that Microsoft forces on its customers.

 

Did you get the 12-bit ADC working?  Or the DAC?   Are there guides to the 0.1" break-out board pins/vias?  It looks like D13 (SPI clock) is not on the silkscreen, or, it might have a different name.

 

Does it load Arduino programs using AVRdude like the standard Arduino?

 

It looks like there is a "pop off" USB micro-B style connector.  Do the side mounting tabs go into plated-thru holes or are they simply soldered onto the PCB top?

 

Please keep us informed on your explorations on this new board.

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

Chinese, like the datasheet 

Or you can get the English version, the chip can run at 32MHz!!

 

Attachment(s): 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Looking at the datasheet it seem to have the M328PB pinout with the extra pin functions.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Simonetta wrote:

Hello,

  Do you have to load a driver for Windows in order to use this new USB-serial IC?   For the Nano, one must download and install the CH341 driver.  Also, with Windows10, I had to disable the "driver signature verification", a weird, paranoid, poorly documented, cumbersome process that Microsoft forces on its customers.

This one has the Holtek HT42B534 USB to serial. The driver auto-installed on Windows 10 (a "up-to-date" test machine with Win 10 crap), had to install manually on my dev PC (Windows 7, but auto update service is offline, so that doesn't mean anything, it may auto-install on a default configuration), but I have not done extensive test for other windows versions.

 

Simonetta wrote:

Did you get the 12-bit ADC working?  Or the DAC?   Are there guides to the 0.1" break-out board pins/vias?  It looks like D13 (SPI clock) is not on the silkscreen, or, it might have a different name.

ADC: Not tested yet.

DAC: I wouldn't call it an actual DAC, it's a programmable resistor ladder, without buffer, so it has no driving capacity.

Guides: Maybe on that forum link I posted in #3, or on this awful site, but most updated stuff is in Chinese.

SPI: I'll post a pic of the backside, the silkscreen is more detailed.

 

Simonetta wrote:

Does it load Arduino programs using AVRdude like the standard Arduino?

Yes, it comes with a bootloader compatible with Arduino. But there is a problem, the auto-reset via DTR doesn't seem to be working (I don't understand why not, maybe DTR is not connected to reset. Maybe it can be modded to work). So you have to press the reset button manually right before the upload, like in the bad old days.

The Arduino stuff can be downloaded from the MCU manufacturer site. As usual, only the Chine version is up-do-date.

 

Simonetta wrote:

It looks like there is a "pop off" USB micro-B style connector.  Do the side mounting tabs go into plated-thru holes or are they simply soldered onto the PCB top?

Its mounted through-hole, however the leads are very short and don't reach the other side. See the picture bellow.

 

js wrote:
Or you can get the English version, the chip can run at 32MHz!!

You know how Atmel has the "Summary" and "Complete" datasheets? That one is the summary. The complete one is Chinese only.

 

Simonetta wrote:

Please keep us informed on your explorations on this new board.

 

I willyes

 

 

Backside pic:

 

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

Is there a 'head in pillow' solder defect on the mcu pin 4 decoupling cap, or is it just an illusion?

 

 

Tom Pappano
Tulsa, Oklahoma

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

You mean on the smaller cap? Yes, it might, I can't tell for sure. Good catch, I will rework it a bit.

 

 

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

Oh!  They have a 32k flash version now?  I noticed when the LGT88 was announced, but and 8k chip wasn't very interesting (particularly with ATmega8 selling for $1.  Though perhaps those are actually the LGTs in counterfeit packaging...)

 

You said you confirmed 32k was present, right?

 

(and: another cheap SOIC USB chip!   that's cool, too!)

 

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

I programmed the chip to do a memory dump, and the bootloader is at word address 0x3A00 (mapped to data address 0xB400), so it must have 32k flash, as expected.

 

This is the memory map from the datasheet, with a few notes of my own.

 

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

Huh.  The text might be in Chinese, but those are REALLY NICE diagrams (pretty much throughout the manual!)

 

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

This time, I'm posting a simple timer output test.

 

The LGT8F328P has 4 timers, 3 of them are compatible with the ones on the Mega 328P, plus one extra 16 bit timer. These timers have several extra features, for example, they can be connected to an internal clock source than runs at twice the main internal oscillator, i.e. @64MHz.

 

This means that irrespective of the CPU frequency, high frequency signals can be generated from the timer outputs. The following are square wave outputs from timer0 @32MHz, 16MHz and 8MHz. Due to the rise and fall times of ~20ns for the I/O ports, the higher frequency outputs are hardly "square". The CPU is running @16MHz in every case.

 

1) CTC mode with internal 64MHz clock source and OCR0A = 0 (32MHz square wave output)

 

2) CTC mode with internal 64MHz clock source and OCR0A = 1 (16MHz square wave output)

 

3) CTC mode with internal 64MHz clock source and OCR0A = 3 (8MHz square wave output)

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

The rise and fall times seemed a bit slow to me, so I compared with one of my Chinese nano clones, with a real Mega 328P. Indeed, the Mega has sharper edges than the LGT clone.

 

Nominal 62.5 ns pulse (8MHz square wave)

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

As I remember (from reading about the 8k part), is that one port it extra high current:

Is this a "normal" IO or high current?

 

 

One of the reasons I was looking at those parts (but never tried them), was the speed, like a rcall with ret take 3clk where it on a normal avr take 7clk, and MUL only 1 clk

 

Do you have a feeling for how big the gain on a "real" program is ? 

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

Hai

Interesting chip and added features than real 328p.
Did you order from Singapore ?

Regards
Tiro

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

sparrow2 wrote:

As I remember (from reading about the 8k part), is that one port it extra high current:

Is this a "normal" IO or high current?

 

 

One of the reasons I was looking at those parts (but never tried them), was the speed, like a rcall with ret take 3clk where it on a normal avr take 7clk, and MUL only 1 clk

 

Do you have a feeling for how big the gain on a "real" program is ? 

 

About the current, I'm not sure... there are several series with the AVR clone CPU, that they call LGT8XM core. The high current peripheral doesn't seem to be always present. The chip I have doesn't seem to have it, I'm not sure because the datasheet I have doesn't have electrical characteristics!

Datasheet examples for different series:

Series A and B, have the high current pins: http://www.lgt-semi.com/wp-content/uploads/2015/06/LGT8F88AB_databook_v1.1.2.pdf

Series D, has opamps: http://www.lgt-semi.com/wp-content/uploads/2016/03/LGT8FX8D-Series-Databook-v1.0.5.pdf

Series P (the one I have), has math peripheral: already linked in post #2. Note that this link is not from the manufacturer, they don't have the datasheet on their site (weird), and the datasheet is incomplete, like I said, no electrical characteristics.

 

Regarding the performance, I intend to test it eventually. Do you have a suggestion that I could use as benchmark? Also, the model I have (LGT8F328P) has a math peripheral that can do 16x16 bit multiplies to generate a 32 bit result and other operations, like division.

 

Using the math peripheral (with a specialized library), and given that it needs to move data around a lot, because of the limited number of registers and move operations available, I estimate 1/4 to 1/2 the math performance of a Cortex M0 at the same frequency. But normally 8bit MCUs are not used for tasks involving high math performance, right?

 

Edit: This may all seem a bit strange to us, but it looks like their official sales channel is a shop in TaoBao, and I think that is not unusual in China. Here is the link.

Last Edited: Sat. Aug 12, 2017 - 04:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interestingly under "Special processor functions" it shows "SWD Two-line debugging / Mass production interface" not quite DW??

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Edit: This may all seem a bit strange to us, but it looks like their official sales channel is a shop in TaoBao, and I think that is not unusual in China. Here is the link.

 

They sell AU MEGA328P-AU for $0.86 

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

China has already made numerous counterfeit (or working clones with low quality). But the only real thing in those clones were the microcontrollers. From now-onward even the MCUs are going to be clones!

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

I disagree.   There is excellent technology that comes out of China.    Often far in advance of U.S. or Japan.

 

Atmel produced a pin-compatible 8051 with their AT90S8515.

 

It looks as if the Logic Green Silicon is a pin-compatible ATmegaxx8 with significant 'extras'.

 

There are a whole range of Silicon designed for and used by the Chinese domestic market.

The manufacturers often do not bother to produce English language datasheets.   And do not bother with the non-Chinese market.

 

It is not surprising that a clever Silicon design team can improve on a 20 year old AVR core and peripherals.    CAD tools,  ideas,  fabrication have all advanced over this period.

And Compiler technology has improved too.

 

Just look at Expressif.   ESP8266 and ESP32 have documentation, tools,  and real life modules that are very impressive.

Compare their performance with an AVR.

 

David.

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

China also manufactures REAL and high-quality iPhones, PCBs, etc, etc. But I am talking more specifically about the "counterfeit" product market of china. Despite of some added features in their 100% AVR compatible clones, it does not seem that it is any sort of legitimate production without the permission of Atmel and Microchip.

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

Why should they have a permission?

Do Atmel(microchip) have one for the 80LP51 ? I don't think so!

 

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

There is a big difference between stealing a complete silicon design and a pin-compatible or tool-compatible.
No one ever complains about fab-less startup companies. Plenty of ASICs start this way. And many clever CPU cores and peripheral silicon.
.
Yes, I am always a bit suspicious of cheap electronics on Ebay. Some will be QC rejects. Some are just good marketing. e.g. Arduino clones with genuine ATmega328P but cheaper CH340 USB chips.
.
I have ordered some 328P and a 328D boards. I would like to buy a SWDICE too. But I can't make any sense out of the link in #20.
Google translate works on the home page but not on any 'shopping' page. At least with Firefox.
.
David.

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

I use Firefox also, sometimes it helps if you translate Taobao in a "private mode" navigation window. It's strange, like they have some kind of anti-translate protection.

 

Edit: or google translate has some built-in weakness, that only allows some pages to be translated using their browser...

Last Edited: Tue. Aug 15, 2017 - 02:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cyber Freak wrote:

China also manufactures REAL and high-quality iPhones, PCBs, etc, etc. But I am talking more specifically about the "counterfeit" product market of china. Despite of some added features in their 100% AVR compatible clones, it does not seem that it is any sort of legitimate production without the permission of Atmel and Microchip.

 

Creating compatible clones can be done in a perfectly legal way, Western companies do it all the time.  Generally, Western companies prefer to create original designs but that is, more to do with marketing. They want you to think they have some special stuff. If you are only interested in making a thin margin by copying a product, then cloning is very common. Just look at the supermarket brands that are cheaper copies of the originals, often mimicking the shape and style. Smart manufacturers play along, by actually making the copies! e.g. same cereal, different box.

 

What is not allowed :

1) "passing off" - applying someone else's brand and styling

2) trademark violation

3) improperly accessing "trade secrets"

4) patent violation

5) copying software, e.g. that might be in ROM

6) copying "mask works"

 

Low cost economies often start in the counterfeit market, then move to clones, then to original products as their skill bases increase. There are certainly plenty of smart people in China, I've worked with some.

Bob.

Last Edited: Tue. Aug 15, 2017 - 02:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:

I use Firefox also, sometimes it helps if you translate Taobao in a "private mode" navigation window. It's strange, like they have some kind of anti-translate protection.

 

Edit: or google translate has some built-in weakness, that only allows some pages to be translated using their browser...

 

I have not got anywhere.   If anyone can navigate around this website,  please could they help.

 

AliExpress and other Chinese sites are quite capable of mailing an item to an address in the UK.   

All that they need is : the item,  my postal address and debit card.

 

David.

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

In a recent thread, the process of buying on Taobao was somewhat explained. Seems complicated and I've never tried, in fact I think they deliver to the US, but not Europe, so I didn't bother. But maybe they'll deliver to the UK? Who knows.

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

Why should they have a permission?  Do Atmel(microchip) have one for the 80LP51 ?

Probably.  My understanding is that one of the reasons that the 8051 architecture has been so successful is that Intel's licensing terms (even back when it was actively licensing the architecture) were extremely reasonable.  No royalties, for example.

 

 

There is a big difference between stealing a complete silicon design and a pin-compatible or tool-compatible.

These chips appear to be a significant re-design of the AVR (16bit ALU, for instance.)  So they're not "stolen silicon."

What they have copied is the basic architecture, instruction set, and basic peripheral operation; things that have always been a pretty gray area.   An instruction set doesn't quite qualify for a patent, nor for copyright protection (although vendors have tried.  and done stuff to avoid "infringing" (thus the z80 has a different set of instruction mnemonics than the 8080.)

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

when Atmel made 2051 and 4051 they paid royalties to intel, that was why they started with AVR!

(and could only make  small chips that couldn't replace  "real" 8751).

 

I really think that the LP versions got around that.

 

 

 

 

 

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

My TTGO XI boards have arrived !!!

Ordered on 12 Aug.   Delivered on 18 Aug.   This must be the fastest shipment that I have ever received from China.

(I think that I paid $1.50 extra for China Post instead of "Free" delivery)

 

I suppose that I will have  play with them.

 

David.

Last Edited: Fri. Aug 18, 2017 - 02:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I soldered the board into a Protoshield.   So I can swap hardware from Uno, Mega, Zero, NUCLEO, ...

First test is to rotate LEDs on D0 - D13.   Worked first time.

However pinMode() does not seem to work on A0 - A5 pins.  i.e. digital mode does not work.

I2C seems to work ok on A4, A5

 

There does not seem to be a separate AVCC pin.   Do I need to connect the SWC, SWD pins?

I presume that AREF already has a 100nF and you do not connect it to power.

 

I am using the Arduino core from https://github.com/wemos/Arduino_XI

 

David.

 

Edit.   Solved it.   lgt8fx8x_init() disables digital with DIDR0 register.   Subsequent pinMode() should enable/disable digital as required.   i.e. needs a patch in wiring_digital.c

Last Edited: Fri. Aug 18, 2017 - 11:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is incredibly interesting. The datasheet is very interesting - on paper it seems to be a powerful, well designed part at an extremely attractive price.

 

Most importantly, the AVR8 ecosystem is growing and it looks like it might become a platform with good 3rd party support, like 8051 and other popular cores. That would be really great news.

 

I had a chat with them on QQ, sadly there is no time frame for getting an English datasheet. I might try to visit them later this year if I end up going over that way on my travels.

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

Ah-ha.  I had never associated your user name with being a Chinese speaker.

 

The LGT datasheets seem to have a lot of English headings.  But with blocks of explanation in Chinese.

 

I would guess that LGT could use their original Chinese document to generate an English version with Translation software.

 

Obviously any machine-generated translation produces a "Chinglish" that is not good for Company Reputation.

But from my point of view,   a Chinglish PDF with the correct format  and layout is a lot easier than manually copy-pasting sequences into Google Translate.

 

Various Online websites claim to translate Chinese PDFs while maintaining appearance.   

The "free" sites just crash.    I would be happy to pay $15 for a translation.    Do you know of any sites that actually work?

 

My LGT8F328P boards work pretty well.  

My LGT8F328D board has not arrived yet.

 

You need to download the Ocrobot Software from http://www.ocrobot.com/doku.php?id=download

Run the ocrobot.exe which is an "Arduino IDE".   Then install the LGT board(s) from the Boards Manager.

 

The LGT cores from Ocrobot seem to be up to date.

The core that I had been using from https://github.com/wemos/Arduino_XI is not so good.

 

Bog-standard Arduino sketches work out of the box.    SPI and EEPROM work fine with the supplied classes.

Direct access to AVR SPI or EEPROM registers in a sketch will require editing.

 

David.

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

A quality translation is going to cost more than $15... For a document that size you would struggle to find someone to do a bad translation for $15 I think.

 

The problem Chinese companies have is that westerners seem to think all their products are cheap crap. There's a lot of racism, frankly. This creates two problems.

 

First, the Chinese company has to put a lot of effort into building an English web site, getting everything professionally translated and checked, and then providing English speaking support staff with good knowledge and skills. A tiny mistake or bit of odd phrasing gets the whole thing branded "chinglish" and the product a "one hung low" POS. It's not like an English web site where we'd just assume it was a typo or Friday afternoon job, or even a European site where we are more tolerant of imperfections in material translated from German or French.

 

Second, even if they do all that, people assume that the technology is ripped off or stolen or won't be on the market for very long. That's starting to change as people realize that western suppliers with 10+ year guarantees on availability are just reselling Chinese stuff with a massive mark-up.

 

These parts are based on the AVR architecture, but the design is clearly their own from scratch. It would be very interesting to see a de-cap comparison.

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

Yes,   I fully understand that a Chinese company would have to employ professional human translators from a reputation point of view.

Yes,   there is a lot of snobbery from the West.     Chinese MCUs and TFT controllers are often more advanced than the Western models.

 

I would be perfectly happy with a machine-generated translation.    I can live with Chinglish.    I would not expect perfection.

Since I am familiar with the ATmega328P,   it is only minor aspects of the LGT chips that I need to study.

 

OTOH,  LGT might not want to sell their chips on the world market.   Or perhaps Western Distributors do not want to handle them.

 

Is my assumption about the PDF correct?   i.e. does it look as if they have prepared the PDF for translation?

 

The LGT chips look very interesting.    They are more advanced than the ATmega328P.    But I am sure that Atmel or any manufacturer could improve any 20 year old MCU design.    Design tools and Fabrication has made great strides in 20 years.

 

David.

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

david.prentice wrote:
I would be perfectly happy with a machine-generated translation.
Doesn't Google Translate let you upload PDF to translate? I thought it did.

 

EDIT: tried but I have a corporate firewall in the way :-(

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

Doesn't Google Translate let you upload PDF to translate? I thought it did.

Yup, just tried it.  Although the results are not a PDF, but a 'live' HTML page i.e. passages are translated on-the-fly as you scroll, so you can't just save the HTML and read offline unless you scroll through the whole document, although you don't need to wait for the translation to proceed as you scroll.  Once you've scrolled to the end (by mouse, not by keyboard), saving the HTML preserves the translation.  Should take about 5-10 minutes for the 286 pages of this document.  And the formatting is more or less clobbered.

 

Still, worthwhile.

 

Maybe Johan could figure out how to capture the translation more easily?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Google doesn't work very well with pdfs, in fact it's terrible. The best I could do was convert the datasheet to word format (using some online converter), then translate it partially using word and/or copy paste to google. But it sure is tedious.

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

Sure, I didn't mean to accuse anyone of anything, just to be clear.

 

I'm not sure about the PDF. They tend not to translate non-words to Chinese, things like register names and acronyms.

 

It's interesting that they are sticking with Chinese. Japanese engineers tend to prefer English datasheets and having good English skills is essential. But China is much bigger, over a billion people in the home market alone, and they seem happy to stick with Chinese. If anything it gives them a bit of an advantage, since they have all these great parts we can't figure out how to use.

 

PDF translation is tricky. Chinese, like Japanese, is much more compact than English for technical information so translation buggers up all the formatting.

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

Well, that was a pain.  I hope it's useful to someone.  You'll almost certainly want to keep the original open for reference to images, layout, etc.

 

 

Attachment(s): 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Thanks, that's actually quite useful. The uDSC looks very interesting.

 

Atmel Microchip should be working with those guys.

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

Joey,

 

I love you.    That is perfectly usable.

 

What was your procedure?

 

Do you fancy doing the LGT8F328D datasheet too?

 

My 328D board arrived this afternoon.   I have just about completed soldering it to a Protoshield with female sockets.  

So I can just plug regular Arduino shields into it.

 

David.

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

At the moment, the only way I managed to do it (haven't explored extensively) is through Chromium "Version 60.0.3112.78 (Developer Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)".  It doesn't seem to work under Firefox on the same platform.

 

  • I visit https://translate.google.com/?tr=f&hl=en
  • Select 'Chinese'
  • Select the .PDF from my file system
  • Click 'Translate'
  • Wait while it uploads
  • Some more clicking to translate when prompted.
  • The crappy part:  scroll with the mouse wheel all the way to the bottom.  Untranslated phrases are translated on-the-fly.
  • After reaching the bottom, I print to PDF.
  • Job done.

 

If you skip the scrolling step above, the printed PDF (or saved HTML) will not be fully translated.  Took me about 10 minutes with a two-handed wheel scrolling technique.  Keyboard scrolling does not work.

 

I'm sure there's a better/faster way.

 

I can try with the other PDF.  Do you have a link?

 

 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

david.prentice wrote:
My 328D board arrived this afternoon. I have just about completed soldering it to a Protoshield with female sockets. So I can just plug regular Arduino shields into it.

 

I also bought a D series and it also arrived in the afternoon mail. At least I hope it's a D series, because it has no markings... After dinner, I'll solder the headers and connect to a serial/USB adapter to see if I can program it.

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

joeymorin wrote:
Maybe Johan could figure out how to capture the translation more easily?

 

Well, you already did the scrolling through and saving so it's not critical anymore, I presume?

 

Still, out of curiosity - Tell me which of the PDFs above you used and if you did "anything special" feeding it to Google Translate, and I'll have a look.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

@Joey,

 

The LGT8Fx8D datasheet link is in #18. i.e.   http://www.lgt-semi.com/wp-content/uploads/2016/03/LGT8FX8D-Series-Databook-v1.0.5.pdf

 

A Web Search finds this website: https://www.onlinedoctranslator.com/

It promises to translate a PDF and preserve the layout.    However it never seems to work.    But presumably it parses the PDF,   uses Google Translate when it finds Chinese text.    And gives you the translated PDF.

 

I would guess that automating the process would be relatively straightforward.   Of course,  I have never seen the result.

 

David.

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

Johan, the PDF I used is linked in #2.  I used the procedure I described in #45.

 

David, I'll give the link in #18 a go when I return this evening (you'll be asleep), and post the results.  However, looks like it's the same datasheet but version 1.0.5 (instead of 1.0.1)...?

 

The one #2 which I did:

http://www.electrodragon.com/w/images/4/47/Lgt8fx8p_databook_v1.0.1.pdf

 

The two in #18:

http://www.lgt-semi.com/wp-content/uploads/2015/06/LGT8F88AB_databook_v1.1.2.pdf

http://www.lgt-semi.com/wp-content/uploads/2016/03/LGT8FX8D-Series-Databook-v1.0.5.pdf

 

Oh I see, different series...

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

It's better with a machine translation from a good datasheet, than than an original english datasheet full of errors. devil 

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

Meanwhile, I had a look at how Google Translate does PDFs - or rather, I had a look at how it is UI-wise.

 

I see the tediousness of forcing translation by scrolling through, as each screen-ful gets translated on-the-fly/on-demand when it comes into view.

 

This is quite different from getting whole (static!) HTML pages programatically and then extract certin elements from them.

 

The whole process is very likely driven by client-side-scripting (I have not confirmed this, but I see no other possibility with this behaviour of the UI).

 

So, we would need to do something like "injecting" a script that slowly scrolls down. It is unlikely that we can detect when a new "chunk" has been translated and we should do a new scroll. It would probably involve reverse-engineering a lot of client-side scripts, and it might be that Google have been smart enough to obfuscate/minimize their scripts (in fact, I would be surprised if they haven't).

 

I know you tickled me baccause of what I did and am doing with the Tutorials TOC, but that was/is quite different - since it involved some interesting learning experience for me and it was/is nice to have a real-world problem to work with. And, as I said, ithe Tutorials TOC is about static HTML pages, whereas Google Translate is likely script laden and highly dynamic. This Google Translate problem will likely just be a frustrating, very time-consuming, reverse-engineering work. And possibly against  a moving target - scripting stuff on the web is not well known for staying stable over time (or over different browsers, for that matter). In fact quite the opposite. It is sort of in the nature of the problem domain - the "Web 2.0".

 

I'll pass on this one, if you don't mind.

 

Alternative idea: Program a USB-enabled AVR to do a HID keyboard device that sends PgDn every 5 or 10 seconds. Set Google TRanslate to translate the Chinese PDF. Start the device and go make coffee ;-)

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Ok, I have confirmed that this board I got today is indeed a D series, or at least it's not a P, because it doesn't have the math peripheral.

 

In case anyone is interested, I'll attach an Arduino program that tests the math peripheral, by squaring each 16 bit number and printing the result to serial.

 

 

Attachment(s): 

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

Like I said, keyboard scrolling doesn't work, neither with PgDn/PgUp, nor with arrows.  The fastest seems to be the wheel.  The good news is that you don't have to wait for the translation before you continue scrolling, but there is a limit to the speed.  I had tried flipping the mouse upside-down and driving it like a wheelbarrow about 3 feet at a time, but that was too fast and portions of the text didn't get translated.  A smooth but speedy two-handed, two-fingered 'ball-wash' technique seems to work well.

 

But dumb.

 

Yeah, I figured it would be a pain, Johan.  Maybe someone else wants to spin their mouse wheel for a 10 minutes or so...? ;-)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

I have one of these. It has little bit different layout than the board in the OP's picture. This does not have "Ocrobot" printed on top side, but has "Wemos" printed in the bottom. LED on this is connected to PB4 a.k.a pin 12 on arduino IDE. Also uploading from Arduino IDE (1.8.4) works great, but with the Ocrobot IDE (0.1.2) I have to "manually" reset the board. I used the Larduino HSP 3.5 package and installed (copied "libraries" and "hardware" directories to my scketch folder as instructed by the documentation) it to Arduino IDE and it seems everything is working so far.

Image of TTGO XI 8F328P-U

Image of TTGO XI 8F328P-U backside

 

This is interesting little chip. Availability is still not great, at least in the usual places. Maybe in taobao one can find the chips them self? I have to have a look.

 

P.S. Sorry for the blurry images. My only camera is integradet to my phone and it is not that great.

Last Edited: Wed. Aug 30, 2017 - 09:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is the one that arrived today, in this case it's also a Wemos brand, more exactly "Wemos XI". It has a LGT8F328D MCU an little else, no crystal, no LDO, basically just a breakout board.

But at least, this one can be connected to a serial/USB adapter and programs with the Arduino IDE without having to press the reset button (auto-reset via DTR line). Not so for the other one.

 

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

I honorable disagree with the concept that Chinese websites need to be translated perfectly and professionally into English. 

After giving the matter a little thought over the years, I've come to believe that there are five levels of machine translation:

  1: word for word  

  2: sentence

  3: paragraph, minimum level commercial

  4: slang, conversation, technical, business

  5: diplomatic and poetry

 

Each level requires an order of magnitude more of processing power.

Most users I believe would be happy with a level three machine translation.

 

As for the output of the mythical One Far Low factory, this appellation is only applied to the products that arrive on distant shores that are clearly and obviously dangerous.

Like the "water heater" that is right-out-of-wall-mains 220VAC line that is plugged into a glass of water.  I refer people to the EEVblog on YouTube for more commentary of this product.

 

Here in Portland, Oregon, USA, we like a good double-entendre.  So when the great restaurant "Hung Far Low" decided to take down their sign, we had the sign turned into a "national historical landmark", and it's still there.

 

 

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

Meh, I know that water heater and that's kids stuff. This is how real men roll: https://www.youtube.com/watch?v=...

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

Et voilà.

Attachment(s): 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

[machine-translated pdfs provided]

Useful, but awfully ugly (page breaks in the wrong place, diagrams destroyed, etc.)  One tends to forget how painful a badly formatted document can be, once you've become used to "pretty" documents.  The sort of thing that you can fix by crowd-sourcing, maybe.

 

I think it was some of the early ESP8266 documents, translated "mechanically" that looked to be pretty bad datasheets, even though they looked like "complete" translations.   Not that there aren't bad data sheets that originated in english to start with.

 

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

joeymorin wrote:
Like I said, keyboard scrolling doesn't work

Hmmm, it worked for me.. .

 

What browser? 

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Click the middle mouse button (wheel) and it turns into a little circle thing with arrows in it. Move it into the lower half of the browser window and it will auto-scroll down forever without you having to do anything.

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

JohanEkdahl wrote:
What browser?

joeymorin wrote:
At the moment, the only way I managed to do it (haven't explored extensively) is through Chromium "Version 60.0.3112.78 (Developer Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)".  It doesn't seem to work under Firefox on the same platform.

 

mojo-chan wrote:
Click the middle mouse button (wheel) and it turns into a little circle thing with arrows in it. Move it into the lower half of the browser window and it will auto-scroll down forever without you having to do anything.

 

Nope.  That's a Windows feature.  Not part of Mate.  Chromium has some available extensions for autoscrolling.  I tried a couple of them.  No joy.

 

Meh.  It was 10 minutes of my life.  I've wasted 10 minutes in worse ways.

 

Oh, and I tried https://www.onlinedoctranslator.com/.  It stalled at lucky thirteen:

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Aug 31, 2017 - 11:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Datasheet translation wrote:
32 of the 6 working registers are used to combine the two 16-bit registers

I guess Chinese sentence structure differs a little from Western and Google Translate got a little confused. Presumably "6 of the 32 ..."?

 

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

clawson wrote:
the two 16-bit registers

two??

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Thu. Aug 31, 2017 - 11:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My LGT8F328D board uploads small sketches ok.   Anything bigger than 4kB gives errors.

 

So I solder SWD header onto the board.  Run the LarduinoISP sketch which reads the "Signature" ok.   (I added a 4k7 pullup to the SWD line)

 

It also managed to erase the chip.   Any subsequent re-install of the bootloader or any firmware fails.

 

Fortunately my LGT8F328P board(s) work ok.   These LGT chips implement "EEPROM" by reserving a section of the 32kB of Flash Memory.

This means that you have less Flash available for your Application than a Uno.   But at least the P bootloader works for the whole area.
 

Many thanks to Joey for his translation of both P and D datasheets.

One further question.   Is it possible to get the default font to be a Narrow Arial instead of TimesNewRoman?

Times fonts must have been invented by the Devil.   (or someone with exceptional eyesight)

 

David.

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

Is it possible to get the default font to be a Narrow Arial instead of TimesNewRoman?

Times fonts must have been invented by the Devil.   (or someone with exceptional eyesight)

I saved the final, fully translated version of the first PDF as an HTML page set, so changing the font was a simple matter of search/replace for 'font-family:Times' and 'face="Times"' with 'Arial' in a text editor, then save, load into Chromium, and print to PDF.

 

I didn't have the presence of mind to save the HTML page set for the second PDF.  When I've got another 10 minutes to kill spinning a mouse wheel, I'll translate it again and save the HTML this time ;-)

 

 

Attachment(s): 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

david.prentice wrote:
My LGT8F328D board uploads small sketches ok. Anything bigger than 4kB gives errors. So I solder SWD header onto the board. Run the LarduinoISP sketch which reads the "Signature" ok. (I added a 4k7 pullup to the SWD line) It also managed to erase the chip. Any subsequent re-install of the bootloader or any firmware fails. Fortunately my LGT8F328P board(s) work ok. These LGT chips implement "EEPROM" by reserving a section of the 32kB of Flash Memory. This means that you have less Flash available for your Application than a Uno. But at least the P bootloader works for the whole area.

 

I'm avoiding doing any ISP programming since we don't have any documentation regarding the protocol, which is most likely different from the Atmel one. We don't even have documentation about fuse settings, so I'll just stick to the bootloader.

 

Fortunately my LGT8F328D accepted a 11k sketch, it's the largest I have to test. This is the vendor I bought from:

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

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

Somebody owes me a pint ;-)

 

 

Attachment(s): 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

@Joey,

 

I love you even more.   The Arial fonts make all the difference.   It is quite pleasant to read now.

Is it me?   Or do other people find Times fonts unreadable?

 

@El Tangas,

 

I presume that the LarduinoISP.ino sketch would be 100% reliable.   It comes from LogicGreen.

I might even try it with the LGT8F328P chip.

 

I suspect that my 328D chip or bootloader was/is faulty.     The 328P bootloader reads Flash ok.

Before I ever attempted ISP,   I tried reading with the 328D bootloader.    This gave avrdude errors.    Displaying memory from a small sketch showed that some of the "higher address" Flash pages contain data.

 

I will probably investigate the problem at a later date.    My 328D board came from Ebay http://www.ebay.co.uk/itm/WEMOS-XI-V1-0-0-LGT8F328D-Module-Board-New/263106271207?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649

It is identical to your Wemos XI board.

 

I am always suspicious when boards are sold with unmarked chips.    It implies that LogicGreen does not want them on the market or they were QC rejects in the first place.

My 328P uploads automatically with the Bootloader.   Yet your identical 328P board needs manual Reset.

 

David.

Last Edited: Thu. Aug 31, 2017 - 02:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, but I looked at the source of LarduinoISP and didn't like what I saw. Look:

 


void read_signature() 
{
  if (CRC_EOP != getch()) {
    error++;
    Serial.print((char) STK_NOSYNC);
    return;
  }
  
  Serial.print((char) STK_INSYNC);
  Serial.print((char) 0x1e);
  Serial.print((char) 0x95);
  Serial.print((char) 0x0f);
  Serial.print((char) STK_OK);
}

 

The signature is hardcoded, it's not actually read from the chip. So I decided to avoid using this software, I don't trust it.

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

LarduinoISP

That would be full of cholesterol.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Lucky the part prefix isnt 'LGBT' - might cause some confusion! Or some out of band Google results.

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

joeymorin wrote:

JohanEkdahl wrote: What browser?

joeymorin wrote: At the moment, the only way I managed to do it (haven't explored extensively) is through Chromium "Version 60.0.3112.78 (Developer Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)".  It doesn't seem to work under Firefox on the same platform.  

 

Strange. I was using "Version 59.0.3071.109 (Developer Build) Built on Ubuntu , running on LinuxMint 18.2 (64-bit)" and PgDn worked just fine IIRC. What I am dead-certain on is that I used the keyboard - not the touchpad, and I had no mouse attached at all.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

I have the LarduinoISP sketch working fine for writing to Flash on the D chip.
It is not working for Read.
I can erase and write to all Flash pages via a running program or with the external ISP programmer (LarduinoISP)
I still have a problem with some pages via the Bootloader.
.
David.

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

So what was the problem earlier?

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

I am not sure what the problem was.   I still do not have a good "Read Flash" with LarduinoISP.   The "Write + Verify" works ok.  Straight "Verify" just reads FF.

 

The good news is that I have managed to open a Taobao account and AliPay account.   And ordered a SWDICE mkII  !!

Chrome works pretty well for translating the Web pages.   But misses things like drop-downs.    So there is a lot of guesswork involved.   And copy-paste of individual sentences into a separate "Google Translate Window".

 

I have to do some further investigation into the Bootloader problem.

I have been able to follow the Larduino commands and the 328D response with a Logic Analyser.   And learned a few tips in the process.

 

The comms are 9-bit LSB-first SPI.   Since it is bidirectional,  I added a CS_WR line and a CS_RD line for the Logic Analyser.

I can see the outward data as mode #3 and the inward replies as mode #2.    Everything becomes clear.

 

My plan is to write a new Bootloader for the full 31.5kB Application Flash  (like a Uno).   Disable the "E2ROM" which wastes a lot of Flash (and I seldom use).

 

I still reckon that these boards are made with QC rejects.  Hence the missing markings.  And our different experience.

But like most Silicon,  even failures have 99% functionality.    I am horrified that any manufacturer would let them out of the factory gate.

 

David.

Last Edited: Sun. Sep 3, 2017 - 01:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, probably they have some kind o defect that is no immediately apparent. My 8F328P doesn't like to reset. The DTR line causes a reset pulse, I've observed with the scope, the chip just doesn't always reset.

 

Also, I'm curious as to how the TaoBao order will unfold. They ship to the UK? I thought they didn't ship to Europe.
 

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

Anyone got any comments on these...

 

http://www.ebay.co.uk/itm/WEMOS-...

 

...might be easier to order from eBay?

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

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

Brian,
That is exactly the same board that I bought from the same Ebay supplier.
The P version comes wiith USB connector, UART bridge and LDO.
The D version that you are looking at requires an external UART and power.
Yes, I think you can get the P board through Ebay or AliExpress. I bought 3 from Ali. So I could mail one to you.
.
David.

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

david.prentice wrote:

I still reckon that these boards are made with QC rejects.  Hence the missing markings.  And our different experience.

But like most Silicon,  even failures have 99% functionality.    I am horrified that any manufacturer would let them out of the factory gate.

 

All that needs is some guy in the Semi-company, to know some guy in the Secure waste collection, and you have a business....

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

@El Tangas,

 

I have been playing with the DSU.   Wondered how easy it would be to use in regular GCC projects.

 

As  you showed in an earlier post,   it is easy to produce external functions.   In fact you produced an inline function with gobbledygook.

 

I have attached two sketches:

 

LGT_dsu_test:  creates externally linked functions using an .S file (I can't manage gobbledygook)

 

fpbench_uno:  my regular timing program.  to run on Uno / LGT.

It illustrates the marginally faster execution due to LGT shorter cycle counts.

 

If you enable a macro in the "__dsu_funcs.S" it will replace some primitive internal multiply and divide functions from libgcc.a

It makes little difference to multiply but divide is dramatic.

 

Requires further tests.   e.g. in LGT_dsu_test harness.

 

I could replace every function from lib1funcs.S but it would not make much difference.

avr-gcc inlines the 16x16 multiply.   So "faster" external libgcc functions would be ignored.

 

You would need to tell GCC to inline the DSU calls instead of inlining the 16x16 "MUL" sequence.

You would also need to alter the optimised f-p primitives.

 

David.

Attachment(s): 

Last Edited: Thu. Sep 14, 2017 - 11:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A gobbledygook function can be inlined, so it's a tad faster than an external asm function, that's why I used it. And because I wanted to learn how to do it... but you are right, for illustration it's a poor choicecheeky

Well, tomorrow I'll check out your code.

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

In an ideal world the Arduino IDE would detect a LGT8F328P:

1. avr-gcc would be given appropriate switches to use DSU calls instead of inlining 16x16 multiply e.g. an extra "avr5_lgt" memory model

2. avr-gcc crts.o (C runtime startup) would enable the DSU.

3. the libm.a and libgcc.a libraries would be optimised accordingly.

4. the punter simply selects a LGT8F328P Board in the IDE.

5. magic happens.

 

In practice,   few people outside of China have seen or used LGT chips.   Writing and maintaining another avr-gcc "model" and Arduino Core is prone to "features"

 

Even the most trivial "feature/problem" would be ridiculed by the West.   And be bad publicity for LGT.

 

My "replacement libgcc primitives" just involve enabling DSU and adding the "__dsu_funcs.S" file to a project.   Regular "long" math operations use these primitives instead of the standard libgcc.a internal functions.   e.g. any regular math expression that involves longs like A = B * C;

 

Inline functions written in gobbledygook can be contained in a "dsu_funcs.h".    Your project can use them by #including "dsu_funcs.h" in a compilation unit.    Existing libc.a or other library code will never know about DSU.    You would need to say: A = dsu_multiply(B, C)

 

David.

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

Whoa, you've been busy and the DSU functions are nicely organized.

I modified your benchmark program a bit because you didn't bench the DSU (or maybe you attached an old version by mistake?). So these are the results for 8F328P:

 

Hello GCC chip:AVR @16000000Hz C:\Users\JMR_2\Documents\Arduino\fpbench_uno\fpbench_uno.ino
    ticks    uSecs     flops OPS/10e6 [iter] operation
    45621     2828    353606  1101519 [1000] overhead loops
   115870     7183    139217   433676 [1000] fp adds
   134265     8324    120134   374230 [1000] fp mults
   475380    29473     33929   105693 [1000] fp divs
  2063963   127965      7814    24343 [1000] log
   491327    30462     32827   102261 [1000] sqrt
  4705320   291729      3427    10678 [1000] pow
   625259    38766     25795    80356 [1000] y=x/m+b using longs
    61292     3800    263157   819762 [1000] y=x/m+b using DSU
    85393     5294    188893   588420 [1000] y=mx+b using longs
    49146     3047    328191  1022349 [1000] y=mx+b using DSU
   249053    15441     64762   201741 [1000] y=mx+b using floats
total ticks is 9101889 [564  ms]

 

...and these are the results for a Mega328P (no DSU, of course):

 

Hello GCC chip:AVR @16000000Hz C:\Users\JMR_2\Documents\Arduino\fpbench_uno\fpbench_uno.ino
    ticks    uSecs     flops OPS/10e6 [iter] operation
    45620     2828    353606  1101519 [1000] overhead loops
   124714     7732    129332   402883 [1000] fp adds
   154164     9558    104624   325915 [1000] fp mults
   496870    30805     32462   101123 [1000] fp divs
  2361223   146395      6830    21278 [1000] log
   496967    30811     32455   101103 [1000] sqrt
  5321083   329907      3031     9442 [1000] pow
   633575    39281     25457    79302 [1000] y=x/m+b using longs
   109098     6764    147841   460540 [1000] y=mx+b using longs
   279045    17300     57803   180063 [1000] y=mx+b using floats
total ticks is 10022359 [621  ms]

So, in conclusion, there is a tremendous speedup for DSU division, significant for DSU multiply and a slight 10% speedup due to core optimizations of LGT vs AVR.

 

 

Attachment(s): 

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

@El Tangas,

 

Your test  was for 16x16 multiplication and 16x16 division.

My test was for 32x32 mult and divide.  e.g.


Hello GCC chip:AVR @16000000Hz C:\Users\David\Documents\Arduino\LGT_sketches\fpbench_uno\fpbench_uno.ino
    ticks    uSecs     flops OPS/10e6 [iter] operation
    49413     3063    326477  1017008 [1000] overhead loops
   115881     7184    139198   433616 [1000] fp adds
   134126     8315    120264   374635 [1000] fp mults
   475334    29470     33932   105704 [1000] fp divs
  2063712   127950      7815    24346 [1000] log
   491505    30473     32815   102224 [1000] sqrt
  4705891   291765      3427    10676 [1000] pow
   625662    38791     25779    80304 [1000] y=x/m+b using longs
    85400     5294    188893   588420 [1000] y=mx+b using longs
   249144    15446     64741   201676 [1000] y=mx+b using floats
total ticks is 8996068 [557  ms]

And when I enabled the replacement "Compiler internals" by editing "__dsu_funcs.S"

#define ENABLE_DSU_INTERNAL_FUNCS 1

The timings changed to:


Hello GCC chip:AVR @16000000Hz C:\Users\David\Documents\Arduino\LGT_sketches\fpbench_uno\fpbench_uno.ino
    ticks    uSecs     flops OPS/10e6 [iter] operation
    49413     3063    326477   385200 [1000] overhead loops
   115881     7184    139198   164235 [1000] fp adds
   134200     8320    120192   141811 [1000] fp mults
   475630    29489     33910    40010 [1000] fp divs
  2064524   128000     16009    18888 [1000] log
   490839    30432     32860    38770 [1000] sqrt
  4705521   291742     33786    39863 [1000] pow
    74390     4612    216825   255825 [1000] y=x/m+b using longs
    77324     4794    208594   246113 [1000] y=mx+b using longs
   248846    15428     64817    76475 [1000] y=mx+b using floats
total ticks is 8436568 [523  ms]

As you can see,  it makes virtually no difference to any of the f-p tests.    Which shows that they must do their own mult and div in ASM.

It improves the y=mx+b calculations from 5.3us to 4.8us per statement.

But the y=x/m+b goes from 38.8us to 4.6us per statement.

 

To make a fair comparison,  you need to write a dsu_mult32x32() function.   This will make four 16x16 DSU_MUL operations,   add them together and return the 32-bit result.   Likewise for a dsu_div32d32() function.

 

You also have to cope with signed and unsigned arguments and results.   Which is why I limited myself to only replace the most primitive libgcc.a functions.    The Compiler looks after the signed, unsigned, casting, extension, truncation, ... issues.

 

The opcode cycle times make a noticeable difference.   e.g. with GPIO and math.

I am surprised that the 16x16 hardware DSU_MUL is not much faster than an AVR doing four 8x8 MUL opcodes.

Of course,   any hardware DIV is better than bit-banged software.   Even if you still need several DSU_DIV ops to achieve 32div32.

 

David.

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

Ah, OK, I didn't realize what you were doing there. OK, you replaced the internal functions that are called by libgcc by your own DSU versions. I wasn't even aware you could do that. Could you point me to some sources explaining this in more detail?

edit: ok, I found it

https://gcc.gnu.org/wiki/avr-gcc

https://gcc.gnu.org/onlinedocs/g...

http://www.avrfreaks.net/comment...

 

Well, I'm not really surprised the speedup is not so great, because there is lots of overhead with data movement. It doesn't matter if the DSU does the operation in 1 cycle, if you must waste 3-4 cycles moving data around (even if they managed to have 16 bit I/O data transfers).

For this to work better, the DSU would need to have DMA, or some kind of command stack, so that it could execute a sequence of commands without CPU intervention, then set a flag when finished.

Last Edited: Sat. Sep 16, 2017 - 09:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have implemented the 32*32 bit multiply __mulsi3 function. Since this is the top level function that calls the 16 bit multiply routines,  a more noticeable speedup can be seen.

I attach the modified code, this function is activated with ENABLE_DSU_INTERNAL_FUNCS higher than 1.

Also, I found that simply accessing variables has a significant overhead (because they are volatile, I suppose), so I included a test for that. Results:

 

Hello GCC chip:AVR @16000000Hz C:\Users\JMR_2\Documents\Arduino\fpbench_uno\fpbench_uno.ino
    ticks    uSecs     flops OPS/10e6 [iter] operation
    45621     2828    353606   417209 [1000] overhead loops
   115870     7183    139217   164258 [1000] fp adds
   134411     8333    120004   141589 [1000] fp mults
   475522    29482     33919    40019 [1000] fp divs
  2064320   127987     16012    18892 [1000] log
   491473    30471     32818    38721 [1000] sqrt
  4705689   291752     33774    39849 [1000] pow
    34146     2117    472366   557330 [1000] variable access overhead longs
    74393     4612    216825   255825 [1000] y=x/m+b using longs
    58292     3614    276701   326471 [1000] y=mx+b using longs
   249053    15441     64762    76411 [1000] y=mx+b using floats
total ticks is 8448790 [523  ms]

now multiply is faster than division, as it should be.

 

edit: minor optimization of __mulsi3:


     out DSDX, X_LO
     //out DSDY, Y_LO   ;this is not needed
     out DSIR, r24

     in  r22, DSAL
     in  r24, DSAH
     ret

 

Attachment(s): 

Last Edited: Sat. Sep 16, 2017 - 01:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Continuing my experiments, I found that LGT8F328D doesn't seem to have the pin toggle feature by writing to PINx, like the Mega 328P. Taking a look at the datasheet, the LGT8F328P is supposed to have this, I haven't tested yet.

Another incompatibility I found is that timed loops like _delay_us run too fast because the sbiw instruction takes just one cycle to execute, so the delays need to be increased by about 30%.

 

edit: basically, it boils down to this line of util/delay.h:

 

  __tmp2 = ((F_CPU) / 4e6) * __us;

For LGT chips, it should be 3e6 instead of 4e6.

Last Edited: Thu. Sep 28, 2017 - 12:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For LGT chips, it should be 3e6 instead of 4e6.

That would be a bit of a hack.  As the timing is actually delivered by __builtin_avr_delay_cycles(), that is what should be modified.  Unfortunately, that means rebuilding the compiler.  So your hack is probably the best bet for now.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Or you could just lie to the compiler (like so many have posted here before) and just set F_CPU to a different value then what the mpu is actually running at!  devil

 

Jim

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

Or you could just lie to the compiler (like so many have posted here before) and just set F_CPU to a different value then what the mpu is actually running at!

That will work only for code which relies on __builtin_avr_delay_cycles().  Other code, such as your own for calculating timer configuration, will break.  But I guess you know that judging by your devil smiley :)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Sep 28, 2017 - 02:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Rubbish.   I tend to use F_CPU when calculating Timer values,  baud rates etc.   This is not dependent on specific opcode cycle times.

 

Yes,  you would need a conditional in util/delay.h

 

I will have to check what the LGT board variants do in the OcRobot Arduino IDE.

But they normally use a Timer rather than cycle-wasting.

 

YMMV.

 

David.

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

Rubbish

Which part?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

joeymorin wrote:

Rubbish

Which part?

Other code, such as your own for calculating timer configuration, will break.

 

 

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

Other code, such as your own for calculating timer configuration, will break.

If you wilfully lie to the compiler with an 'adjusted' F_CPU in order to get __builtin_avr_delay_cycles() [via _delay_ms/us()] to generate correct delays [due to different instruction cycle-counts for the LBT* v.s. AVR cores], as was suggested by @ki0bk, then >>of course<< it will break other code which relies on F_CPU.  So no, not rubbish.

 

If you hard-code timer configurations 'by hand' rather than computing it via the preprocessor [based on F_CPU], then no, changing F_CPU won't break the timer config.  But then, if you're hard-coding then your code is already broken ;-)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

My apologies.   We are at cross purposes.

 

I would never consider lying about F_CPU (the clock frequency)

Timer calculations depend on the clock frequency.

 

On the other hand,   the delay macros just use some constants to calculate _delay_us etc.

It is only necessary to make these conditional in the util/delay.h system header.

 

I doubt if there is anything in the pre-compiled system object libraries that depends on util/delay.h

 

In an ideal world,   avr-gcc would have an LGT model and recognise Logic Green cpus.

But the current strategy is to build with Atmel tools as if it was a genuine ATmega328.

 

Things like Maths CoProcessor and EEPROM are completely different.

It is interesting to investigate as El Tangas has shown.

 

In practice,   most hobbyists would just build Arduino code that works "better" on LGT.

 

David.

Last Edited: Thu. Sep 28, 2017 - 07:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is only necessary to make these conditional in the util/delay.h system header.

No, it would be necessary for every invocation of a delay macro:

#undef F_CPU
#define F_CPU <some-number-which-lies>
  _delay_ms(FOO);
#undef F_CPU
#define F_CPU <real-F_CPU>

What's more, depending on the length of the delay, and whether or not the underlying code generation makes use of sbiw or other instructions with cycles counts different from the AVR core, the required adjustment will be different.

 

Although it should be possible to provide an alternate _delay_basic.h, and patch _delay.h to use those routines when an LGT is detected, obviating the need to fudge F_CPU at all.

 

I doubt if there is anything in the pre-compiled system object libraries that depends on util/delay.h

 

Anything which depends upon __builtin_avr_delay_cycles(), _delay_loop_1(), or _delay_loop2() will break due to the differences in the LGT* cores.  In fact, anything which relies on cycle counting in any way is at risk.

 

avr-gcc would have an LGT model and recognise Logic Green cpus.

Unlikely that Microchip would spend effort to add support for a competitor's device.  Logic Green would need to invest some time to make their own back end, or a patch, or at the very least device headers.

 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Sep 28, 2017 - 07:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go on.   It is not difficult to make one edit to the system util/delay.h

 

Yes,   I know that it is generally unwise to touch any system files.   But this is a one-off.   And it is completely transparent to the regular AVR build.

 

Any Arduino build is already accustomed to board macros being passed to the build system.

Any GCC user is accustomed to target macros e.g. __AVR_ATmega328P__

 

I differentiate between different STM32 Cores according to the presence of macros.

I differentiate between GCC, Codevision, ImageCraft, IAR, Rowley,  ... according to predefined Compiler macros.

 

David.

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

Go on.   It is not difficult to make one edit to the system util/delay.h

And what edit would that be?

 

It's not really a simple edit, but several carefully thought out edits would be required.  Simply massaging F_CPU isn't a general solution, as I've mentioned.  The underlying primitives used [_delay_loop_1(), _delay_loop_2(), and __builtin_avr_delay_cycles()] will not have a purely linear relationship to F_CPU w.r.t. the changed cycle counts.  Careful changes would be needed.

 

Sure, a rough linear approximation that's 'good enough' would be simple to do, but it would be cycle-accurate.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

The relationship is either 4 cycles per loop with SBIW or 3 cycles per loop with SBI on an AVR.

This would be 3 cycles for SBIW on a LGT.

 

You can adjust for the initial register setup.   And the final shorter exit.    Quite honestly,  I am not going to worry if a _delay_ms(1) is accurate to the nanosecond.   Remember that the AVR build is unchanged anyway.    You are only quibbling over the LGT target that you have never even used.

 

Incidentally,   my initial attempt to buy a SWDICE did not get very far.    But I hope to receive one via a Taobao agent shortly.

 

I still suspect that the LGT boards that have appeared on AliExpress are samples / QC failures.   But they are certainly very interesting.

I doubt if they will ever break into the world AVR market.   Or if LGT even want to.

 

David.

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

__DELAY_BACKWARD_COMPATIBLE____DELAY_BACKWARD_COMPATIBLE____DELAY_BACKWARD_COMPATIBLE____DELAY_BACKWARD_COMPATIBLE____DELAY_BACKWARD_COMPATIBLE__OMG, what happened here... I can't edit this, please delete

__DELAY_BACKWARD_COMPATIBLE__

Last Edited: Thu. Sep 28, 2017 - 09:40 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Something very weird just happened I can't edit, please delete the above post, and this one.

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

You are only quibbling over the LGT target that you have never even used.

Never used, true.  Quibbling, false. ;-)

 

__DELAY_BACKWARD_COMPATIBLE__

That doesn't fix anything.  No matter how many times you define it ;-)

 

All it does is avoid the use of __builtin_avr_delay_cycles() in favour of _delay_loop_1() and _delay_loop_2().  The latter still relies on the use of sbiw, and the 'fact' that it takes two cycles.  Only _delay_loop_1() avoids sbiw, and is only used by _delay_us() for very short delays (less than 256 loops, or 'ticks', at F_CPU).

 

It's all a tempest in a teapot.  I only started down this road when @ki0bk joked about faking F_CPU, and I responded while acknowledging the joke.  I don't really care one way or the other, since as David points out I haven't used the LGT, nor am I likely to.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Something very weird just happened I can't edit, please delete the above post, and this one.

I bet I know what.  You copied __DELAY_BACKWARD_COMPATIBLE__ from the online AVR Libc docs, and tried to paste into a forum post.  The docs use a BBcode-like formatting which employs square brackets.  The forum software will happily display it correctly once posted, but the editor Javascript will not.  You paste, but see nothing.  It's there, so when you click post, it appears.

 

I guess you pasted a few times, wondering why you couldn't see it... ;-)

 

Blame the saxophone players.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Yeap, it was exactly that cheeky

But anyway, __DELAY_BACKWARD_COMPATIBLE__ combined with editing this line:

__tmp2 = ((F_CPU) / 4e6) * __us;

replacing 4e6 by a define that can be 4e6 for normal AVRs or 3e6 for LGT AVRs would work and it's just a minor edit.

 

edit: well, for _delay_us at least... _delay_ms also needs edits.

Last Edited: Thu. Sep 28, 2017 - 11:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As the timing is actually delivered by __builtin_avr_delay_cycles(), that is what should be modified.

 So ... what would be the procedure/logistics for getting separate "clone" CPUs that are "almost like X" added to avr-gcc ?  Atmel (Microchip) is more-or-less gatekeeper of new devices for avr-gcc, right?

SBIW is not the only timing difference with these chips; I'll bet that things like VUSB and Atomic Zombie's video code break as well...

 

(BTW: these are very good observations - thank you for poking around at the chip!)