Author Topic: ATSAMS70n19 based board  (Read 607 times)

0 Members and 1 Guest are viewing this topic.

Offline amadeok

  • Contributor
  • Posts: 13
  • Country: it
ATSAMS70n19 based board
« on: April 15, 2021, 01:19:23 pm »
Hello
I was looking for a MCU that could handle high speed usb transfer and i found this  ATSAMS70n19 development board that claims can do it

Has anyone tested one like that ? Is it complicated to get the USB high speed working? I also found a open source project https://github.com/jaw0/se7eduino
To 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 signals
thanks
« Last Edit: April 15, 2021, 01:21:02 pm by amadeok »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 7510
  • Country: us
    • Personal site
Re: ATSAMS70n19 based board
« Reply #1 on: April 15, 2021, 04:58:04 pm »
I have not tested this specific board, but SAM N70 does work in USB HS mode. Here you can find a simple USB stack https://github.com/ataradov/free-dap/tree/master/platform/same70 and here is my design of a breakout board board https://github.com/ataradov/breakout-boards/tree/master/same70

It 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 this https://github.com/ataradov/embedded/blob/master/sam-ba/sma-ba-v71.py to program it.
« Last Edit: April 15, 2021, 05:10:52 pm by ataradov »
Alex
 

Offline amadeok

  • Contributor
  • Posts: 13
  • Country: it
Re: ATSAMS70n19 based board
« Reply #2 on: April 15, 2021, 11:46:18 pm »
I have not tested this specific board, but SAM N70 does work in USB HS mode. Here you can find a simple USB stack https://github.com/ataradov/free-dap/tree/master/platform/same70 and here is my design of a breakout board board https://github.com/ataradov/breakout-boards/tree/master/same70

It 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 this https://github.com/ataradov/embedded/blob/master/sam-ba/sma-ba-v71.py to program it.
Hi 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
 

Offline tmadness

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: ATSAMS70n19 based board
« Reply #3 on: April 16, 2021, 01:14:56 am »
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?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 7510
  • Country: us
    • Personal site
Re: ATSAMS70n19 based board
« Reply #4 on: April 16, 2021, 06:01:11 am »
Can i program it with any jtag programmer ?
Any SWD programmer that is supported by the software you will be using for programming.

Can you tell me which one would be better to drive an eink display, the pi zero or the sam s7?
That 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?
Alex
 

Offline amadeok

  • Contributor
  • Posts: 13
  • Country: it
Re: ATSAMS70n19 based board
« Reply #5 on: April 16, 2021, 10:05:26 am »
Can i program it with any jtag programmer ?
Any SWD programmer that is supported by the software you will be using for programming.

Can you tell me which one would be better to drive an eink display, the pi zero or the sam s7?
That 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?

Hi yes i have something working already:
I'm using the Epdiy eink controller board: https://github.com/vroland/epdiy
i'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 multiple different framebuffers for a single greyscale 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.
 

Offline tmadness

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: ATSAMS70n19 based board
« Reply #6 on: April 16, 2021, 05:06:09 pm »
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.html
Quote
Teensy's primary communication is its main USB port, which operatates in USB device / peripheral mode at 480 Mbit/sec speed.

The 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.
« Last Edit: April 16, 2021, 05:17:06 pm by tmadness »
 

Offline amadeok

  • Contributor
  • Posts: 13
  • Country: it
Re: ATSAMS70n19 based board
« Reply #7 on: April 17, 2021, 09:54:19 am »
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.html
Quote
Teensy's primary communication is its main USB port, which operatates in USB device / peripheral mode at 480 Mbit/sec speed.

The 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.

Hi
Yes 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.
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: gb
Re: ATSAMS70n19 based board
« Reply #8 on: April 17, 2021, 10:52:54 am »
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.
 

Offline amadeok

  • Contributor
  • Posts: 13
  • Country: it
Re: ATSAMS70n19 based board
« Reply #9 on: April 17, 2021, 03:41:01 pm »
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.
You 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
 

Offline jsilva

  • Contributor
  • Posts: 7
  • Country: pt
Re: ATSAMS70n19 based board
« Reply #10 on: April 22, 2021, 07:41:30 pm »
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.
You 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
You 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.
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: gb
Re: ATSAMS70n19 based board
« Reply #11 on: April 26, 2021, 01:07:13 am »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf