Comments (6)
Ok. We can use dma for this purpose.
from 6-axis-usbcnc-grbl.
Is it possible to use DMA when you do not yet know the number of char to be sent?
I presume, the logic is currently to call "serial_write()" byte per byte from many place in the code.
Is it not easier to fill a buffer and use an interrupt to sent the data in the buffer?
from 6-axis-usbcnc-grbl.
Maybe. We have to think.
from 6-axis-usbcnc-grbl.
I changed the code in order to toggle a pin each time the program goes into the main loop (in protocol.c). I put a digital scope on the serial RX and TX signal and on this pin.
I can confirm that when GRBL is sending the status (in reply to a "?"), the STM32 does not enter anymore the main loop for about 3.2 ms.
This delay would not exist if sending via UART would use a buffer and an interrupt
from 6-axis-usbcnc-grbl.
I made changes in order to use interrupts when sending data via UART (in order to avoid locking the main loop).
Code concerns main.c, serial.c and serial.h
I tested the code with UART and it seems OK.
Code is available on my site (in branch master)
https://github.com/mstrens/grbl_6axis_on_stm32
In this code there are also some changes in order to check the timing of the protocol_main_loop (in protocol.c) and the timing of handling the set/dir in interrupts (in stepper). The principe is to change the pin flood and mist (just for debug). It is activated in protocol.c with parameter
#define DEBUG_TIMING_WITH_FLOOD_AND_MIST
from 6-axis-usbcnc-grbl.
I made a new change in order to put #define DEBUG_TIMING_WITH_FLOOD_AND_MIST in grbl.h (instead of protocol.c; it was wrong).
I also now change the flood pin when I change the X step pin (it is for my current testing).
it could even change for future test. So look at the code if you want to use such a debug function
from 6-axis-usbcnc-grbl.
Related Issues (20)
- Dual Y axis HOT 1
- backlash compensation HOT 1
- OT Question: How to create the pinout diagram like this? HOT 2
- only x axis can reach 230khz, y and z axis have problem HOT 1
- CNCjs Issue due to bug in mode state reporting HOT 5
- Makefile? HOT 3
- ! news. Project is no longer supported. HOT 3
- $h then system happens to restart
- configure grbl with "$x=val" commands (optional)
- about coolant! HOT 2
- pcb for this project (inside)
- Planner buffer question
- Installation on arduino uno or nano. HOT 1
- Using UART3 same times with UART1 please HOT 1
- Set machine positions for homed limit switches HOT 1
- Probing Issue
- Uart1 cant connect hc05 bluetooth HOT 1
- UART TX overlapping
- What is the problem that the serial port cannot communicate?
- No #undef USEUSB in grbl.h
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 6-axis-usbcnc-grbl.