ATSAMS70n19  based board - Page 1
Forum section: electronics / general

author: amadeok
author_rank: Contributor
timestamp: April 15, 2021, 01:19:23 pm
content: HelloI was looking for a MCU that could handle high speed usb transfer and i found this ATSAMS70n19 development board that claims can do itHas anyone tested one like that ? Is it complicated to get the USB high speed working? I also found a open source projecthttps://github.com/jaw0/se7eduinoTo program it is it similar to the ESP-IDF sdk? we write in C and then we flash?I would like to use the chip to drive an eink display, so i'd have to drive some time sensitive signalsthanks

author: ataradov
author_rank: Super Contributor
timestamp: April 15, 2021, 04:58:04 pm
content: I have not tested this specific board, but SAM N70 does work in USB HS mode. Here you can find a simple USB stackhttps://github.com/ataradov/free-dap/tree/master/platform/same70and here is my design of a breakout board boardhttps://github.com/ataradov/breakout-boards/tree/master/same70It is a standard MCU, so generally yes, you write code in C and then flash it. You either need a programmer, or you can use internal bootloader (SAM-BA). On a erased device it would enumerate as a COM port, and you can use a script like thishttps://github.com/ataradov/embedded/blob/master/sam-ba/sma-ba-v71.pyto program it.

author: amadeok
author_rank: Contributor
timestamp: April 15, 2021, 11:46:18 pm
content: Quote from: ataradov on April 15, 2021, 04:58:04 pmHi thanks for reply. Can i program it with any jtag programmer ? I was looking at the rasbperry pi zero also. Can you tell me which one would be better to drive an eink display, the pi zero or the sam s7? eink displays need an 8 bit bus with a clock to send the pixel data and also some other signals (http://essentialscrap.com/eink/index.html) . I'd prefer to use the SAM s70 because someday maybe i'd like to make a custom board and it seems to be easier to do it with the sam s70. I need it to support high speed USB or to have some other form of fast data transmission from the pc because i'm making a sort of pc monitor (https://github.com/amadeok/Epdiy-Eink-PC-monitor/tree/main/pc_monitor), and i'm using a board with a esp32 but i'm using wifi and it's slow at about 20mbps hence i was looking for something faster

author: tmadness
author_rank: Regular Contributor
timestamp: April 16, 2021, 01:14:56 am
content: Have you done any prototypes/proof of consepts? Because last I heard eink full refreshes take for ever. Even using a partial refresh I dont see how you can saturate a USB FS, let alone need HS.Also 20 mb/s was not enough? what is this transfer protocol. Also are you sue that its a bandwidth issue and not a latency one?

author: ataradov
author_rank: Super Contributor
timestamp: April 16, 2021, 06:01:11 am
content: Quote from: amadeok on April 15, 2021, 11:46:18 pmAny SWD programmer that is supported by the software you will be using for programming.Quote from: amadeok on April 15, 2021, 11:46:18 pmThat really depends.But yes, there is no meaningful way E70 can process HS data at a sustained rate anyway. How was 20 mbps not enough? What are you transferring there?

author: amadeok
author_rank: Contributor
timestamp: April 16, 2021, 10:05:26 am
content: Quote from: ataradov on April 16, 2021, 06:01:11 amHi yes i have something working already:I'm using the Epdiy eink controller board:https://github.com/vroland/epdiyi'm using a ED097TC2 eink display, which has a resolution of 1200x825 pixels. Each pixel needs 2 bits, so a framebuffer is 247500 bytes . So i wrote that pc mirroring application (which you saw in the video) which captures the screen, compresses it with RLE and sends it to the ESP32 on the board via wifi. When the screen didn't change much the RLE compression is very efficient, for example when just moving the mouse the size of the compressed framebuffer is just around 4000 bytes. But when a lot changed like when scrolling through text, the size can be even 70 % of the original size and in the worst cases even the same or a bit more than the original size. Once the data is in the ESP32 the time it takes to draw the image depends on the settings we choose because we have direct control over the signals. To get better image I write the same framebuffer multiple times. For instance to draw it 4 times it takes about 80 miliseconds.So the wifi transfer + extraction of the framebuffer can take anywhere from around 20ms to 150 miliseconds, and then the time for the driver to write the image is 80 ms with my settings, so it's a total of 100 ms to 230 more or less. So i would really like to be able to reduce or eliminate this extra time added by the wifi transfer / extraction.It can be noted that since i'm just doing monochrome the rle compression is often quite effective, but to do greyscale multipledifferentframebuffers for asinglegreyscale image are required, and while i haven't tested that myself the guy who made the epdiy board tried it and he said that indeed the wifi speed is not enough.

author: tmadness
author_rank: Regular Contributor
timestamp: April 16, 2021, 05:06:09 pm
content: Interesting.If you have a particular affinity to ATSAM go for it.I would personally try out the teensy 4.1.From the main product page:https://www.pjrc.com/store/teensy41.htmlQuoteThe community around teensy is strong so if you have questions visit the teensy forum. I have not required FS level speeds, so I have not tried FS speeds but give it a shot.But like ataradov said You will not be able to hold FS speeds for long, but the teensy may keep the throuput for longer with its 600MHz + external ram buffers. Maybe once you have USB testing done you can decide if what you really need is a FPGA.Also the 20-150 ms response time looks about right, The ESP did have a lot of latency when I used it last. I remember seeing a few ways you could drop the latency down but the latency was fine for my usage. AFIK even well written stacks on laptop PCIE wifi cards have upto 10s ms latency. The wifi+tcp stack is bigger/more complicated than usb. Wifi with its hub-spoke design cannot be used easily for real time tasks like live audio streaming.

author: amadeok
author_rank: Contributor
timestamp: April 17, 2021, 09:54:19 am
content: Quote from: tmadness on April 16, 2021, 05:06:09 pmHiYes the teensy seems better for me also because of the reasons you mentioned, but if i ever want to make a custom board with the IMXRT1060 which is the cpu used in teensy 4.1 and 4.0 i would run into problems because of lack of open source boards to have as reference, while i have found some open source desings for atsam chips based boards.Yes in fact as it is now i'm able to use my eink display as a monochrome monitor without major issues, the latency is not a major problem, the mouse does not feel too slow for me to use, but the quality of the draw is not always spot on as in a commercial eink monitor which uses the original vendor waveforms.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: April 17, 2021, 10:52:54 am
content: I have used the same chip as part of a USB PC scope.I used harmony 3 and MPLAB X to create the software.Bit of a steep learning curve if you havent used Harmony 3 before but it works.

author: amadeok
author_rank: Contributor
timestamp: April 17, 2021, 03:41:01 pm
content: Quote from: nigelwright7557 on April 17, 2021, 10:52:54 amYou used the ATSAMS70n19 ? And were you able to flash it with SAM-BA?Or could you tell me where to find a cheap swd programmer? the ones i found were like 120€if i'm able to flash it that's enough for me

author: jsilva
author_rank: Newbie
timestamp: April 22, 2021, 07:41:30 pm
content: Quote from: amadeok on April 17, 2021, 03:41:01 pmYou can use a cheap FT2232H breakout as a JTAG/SWD probe, and since it has two channels, you can even use the other one in UART mode and capture the SWO line, and have a console, for example.I have used it in the past with that same MCU family, since I found out the hard way that the JLink V8 clones from china do not work with M7 cores...I use an extension called Cortex-Debug for VSCode.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: April 26, 2021, 01:07:13 am
content: I used a Microchip Snap programmer about £15.It works with MPLAB X which most people either love or hate !I did a lot of the setting up using Harmony 3.