how to use viper decorator?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
User avatar
Roberthh
Posts: 1890
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: how to use viper decorator?

Post by Roberthh » Sat Sep 28, 2019 7:00 am

As far as I recall nop() uses two clock cycles. That is the delay caused by it. At 160MHz, this is 12.5 ns.
b.t.w. Just in case assembler is a little bit inconvenient: Viper code usually only takes twice as long as assembler.

starter111
Posts: 40
Joined: Wed Mar 08, 2017 7:24 am

Re: how to use viper decorator?

Post by starter111 » Sat Sep 28, 2019 7:28 am

thank you so much, is it C module faster than assembly maybe not much?

User avatar
pythoncoder
Posts: 4030
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: how to use viper decorator?

Post by pythoncoder » Sat Sep 28, 2019 7:45 am

starter111 wrote:
Sat Sep 28, 2019 7:28 am
thank you so much, is it C module faster than assembly maybe not much?
Interesting question. I think carefully optimised assembler will beat C. But see this forum thread which shows that in a real application C can be four times faster than assembler. In this instance the assembler was written for ease of coding but rewriting it to match (let alone exceed) the C performance would take a great deal of work.
Peter Hinch

starter111
Posts: 40
Joined: Wed Mar 08, 2017 7:24 am

Re: how to use viper decorator?

Post by starter111 » Sat Sep 28, 2019 8:01 am

https://store.micropython.org/product/PYBD-SF6-W4F2

pybaord D?
is this mean can add 2MiB RAM?
2MiB external QSPI flash with execute capabilities to extend internal flash

User avatar
Roberthh
Posts: 1890
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: how to use viper decorator?

Post by Roberthh » Sat Sep 28, 2019 8:19 am

PYBD_SF6 has 2 MByte internal flash. All PYBD models have additionally 2 MByte external flash for program code, and another 2 MByte flash for the file system. There is no external RAM. The SF6 does not use the external flash for code at the moment. The SF2/SF3 do.

User avatar
pythoncoder
Posts: 4030
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: how to use viper decorator?

Post by pythoncoder » Sat Sep 28, 2019 8:27 am

It has 512KiB of RAM: in the context of most embedded programming 512KiB is a lot of RAM: you'd need to be writing a large (many thousands of lines) program, or using big data structures, to run out of RAM on this board.

If it is not currently possible to use the external flash for program storage this feature will surely come with a firmware upgrade, as this is the chip's only purpose (AFAIK).
Peter Hinch

starter111
Posts: 40
Joined: Wed Mar 08, 2017 7:24 am

Re: how to use viper decorator?

Post by starter111 » Sat Sep 28, 2019 8:03 pm

Is for data, I'm trying run test pattern. If I can load all to the ram at one time and run, it more close to actual. Most of them are short can execute them all in one, but few of them are huge, I need copy few hundred MB pattern to flash and have to stop in the middle which I'm not sure going work, the device might timeout.....

Post Reply