Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 17, 2020 09:36AM |
Registered: 12 years ago Posts: 224 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 17, 2020 12:00PM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 17, 2020 01:09PM |
Registered: 12 years ago Posts: 224 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 18, 2020 06:09AM |
Registered: 11 years ago Posts: 341 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 18, 2020 08:31AM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 19, 2020 03:05AM |
Registered: 11 years ago Posts: 341 |
Quote
gloomyandy
It is a nice solution (and I had a good look at it when adding software serial to Marlin) but it uses a lot of resources (3 256 byte memory buffers, plus one of the general purpose timers and the gpdma channel). I'm not that familiar with the reprap LPC implementation so I'm not sure if those resources are available for use or not. I was particularly conscious of how tight memory is. It also makes use of FIOMASK (to restrict the dma writes to a single output bit on the port), but I'm not sure what impact using that might have on other I/O operations on the same port while the dma transfer is active (it certainly seems to impact some of them). It would be interesting to see if it could be made to work though as the dma usage would avoid the errors I see due to other parts of the system either disabling interrupts or higher priority interrupts running.
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 19, 2020 03:41AM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 19, 2020 03:53AM |
Registered: 11 years ago Posts: 341 |
Quote
gloomyandy
That sounds very interesting! I'd certainly like to give it a try. But I think I need to spend some time reading up on bitbanding! Are there examples of using bitbanding already in the code?
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 19, 2020 04:03AM |
Registered: 12 years ago Posts: 224 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 19, 2020 04:17AM |
Registered: 11 years ago Posts: 341 |
Quote
jay_s
The networking version doesn't build due to missing files.
The RTOSPlusTCPEthernet folder is missing from the 3.01 branch. It is a case of just copying it from the 3.0 branch?
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 20, 2020 08:38AM |
Registered: 12 years ago Posts: 224 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 21, 2020 01:25AM |
Registered: 11 years ago Posts: 341 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 21, 2020 03:22AM |
Registered: 11 years ago Posts: 341 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 21, 2020 03:35AM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 22, 2020 06:02PM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 22, 2020 08:33PM |
Registered: 11 years ago Posts: 341 |
Quote
gloomyandy
Hi,
so I think I may have figured out a way to use DMA for the TMC22xx UART. I'm still experimenting a little, but I think it will work. I've just noticed though that you are now using TIMER1 for the ADC smoothing code, are there any other free timers available?
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 24, 2020 04:17PM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 24, 2020 06:20PM |
Registered: 11 years ago Posts: 341 |
Quote
gloomyandy
Quick update. I now how a working DMA based UART that seems to work pretty well. This code has a much lower interrupt overhead than that from the previous pure timer based version. It generates a single interrupt per byte being transmitted and just a single interrupt at the end of the receive, this compares with 3 interrupts per byte for both transmit and receive with the timer solution. I'm still working on improving some aspects of the code (reducing memory if possible, it currently requires around 500bytes). One problem I have seen is the occasionally the TMC2208 does not send a response. Hooking up a logic analyser revealed that this was because occasionally there was a glitch in the data being written to the driver, which resulted in the TMC2208 not recognising the command. This was being caused by the dma write occurring between the read modify write operation used in digitalWrite, I'm pleased to say that updating to the latest version from sdavi (and so picking up the bit banding implementation of digitalWrite has fixed that problem).
My version of the DMA UART is based on the original code by Artem-B that was linked above. However that had some problems during write operations that made it unsuitable for use with RRF. The main issue was the use of FIOMASK to enable writes via DMA to only a single bit. My version avoids this issue by creating a chain of linked DMA control blocks one per bit of the UART write data. Each control block writes to either FIOSET or FIOCLR (which allows writing to a single bit of the port). The read side of things follows the same basic scheme used in the original code (though switching from output to input is handled differently to avoid issues with the read modify write nature of the original). I'm still experimenting with the best possible configuration of this code, but it is looking promising.
A quick question for anyone with a duet that uses TMC22XX devices (@dc42 perhaps), do you ever get any read/write or timeout errors on the TMC I/O (shown by M122)? I'm still seeing some errors, but I'm curious if this is completely down to the use of a software UART or if there are still errors when using the hardware implementation?
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 25, 2020 02:05AM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 25, 2020 10:06AM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 25, 2020 06:20PM |
Registered: 11 years ago Posts: 341 |
Quote
gloomyandy
Hmm that's interesting (and puzzling), if I set the priority used by the GPDMA to anything below 5 then my board hangs (or at least it never appears as a USB device on my PC). It does the same both with and without my DMA UART code enabled. Any idea what may be going on? Not sure if it matters but I have the esp wifi code enabled and have a WiFi module attached but not enabled (I usually issue the M552 S1 command to enable it via a USB terminal connection). The USB interrupt is at priority 5, I wonder if there is any sort of interaction?
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 25, 2020 06:42PM |
Registered: 11 years ago Posts: 341 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 31, 2020 04:24AM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards January 31, 2020 06:42AM |
Registered: 11 years ago Posts: 341 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards February 02, 2020 05:37PM |
Registered: 4 years ago Posts: 213 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards February 03, 2020 09:45PM |
Registered: 11 years ago Posts: 341 |
Quote
gloomyandy
A quick question, what pwm frequency makes sense for fans/heaters on the LPC? At the moment I'm just using the default values which I think is 250 (I assume Hz?) and comes from DefaultFanPwmFreq, is this a sensible value for things like the heatbed?
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards February 04, 2020 09:20AM |
Registered: 12 years ago Posts: 224 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards February 04, 2020 09:15PM |
Registered: 11 years ago Posts: 341 |
Quote
jay_s
@sdavi
Does your wifi password use any numbers?
I've had issues getting my board to connect to a wifi network when there are numbers in the password.
The board reports that the password is incorrect, but if I change the password to all letters, it connects without issue.
Just trying to marrow down if this is something with just me or whether its a more widespread issue.
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards February 05, 2020 02:21AM |
Registered: 12 years ago Posts: 224 |
Re: RepRapFirmware 3.0 port for LPC1768/9 based boards February 05, 2020 04:13PM |
Registered: 12 years ago Posts: 224 |
M574 X1 S1 P"xstop"and
M574 X1 S1 P"1.29"Neither of these show as triggering in M119 or DWC.