Welcome! Log In Create A New Profile

Advanced

BLOCK BUFFER SIZE, BUFSIZE and SD ramps!!

Posted by chik 
BLOCK BUFFER SIZE, BUFSIZE and SD ramps!!
October 30, 2013 06:28AM
Hi,

I am using Marlin with ramps 1.4 and arduino, and I want to know the max buffer when we are reading the SD card.
I found BLOCK BUFFER SIZE defined on configuration_adv.h, but I cannot understand the difference with BUFSIZE!!

Thank you
Re: BLOCK BUFFER SIZE, BUFSIZE and SD ramps!!
October 31, 2013 12:02PM
You can modify your own messages for a limited amount of time chik (if you think it is not clear).


Most of my technical comments should be correct, but is THIS one ?
Anyway, as a rule of thumb, always double check what people write.
Re: BLOCK BUFFER SIZE, BUFSIZE and SD ramps!!
October 31, 2013 01:38PM
I post a new message, where I detail my problem : [forums.reprap.org]

I am sorry!!
Re: BLOCK BUFFER SIZE, BUFSIZE and SD ramps!!
October 31, 2013 06:35PM
It reads 75% of the buffer and then loads a new one.
Re: BLOCK BUFFER SIZE, BUFSIZE and SD ramps!!
November 08, 2013 12:10PM
Thank you uncle_bob for your response.

But, if we send just one command, it will read it directly. It does not wait 75% of the buffer. I am searching for the loop, where it wait to reach the 75% of the buffer, and I didn't find it.
I don't understand realy what does it do, when we send a complete Gcode through Pronterface. Please help me
Re: BLOCK BUFFER SIZE, BUFSIZE and SD ramps!!
November 08, 2013 04:23PM
Quote
chik
Thank you uncle_bob for your response.

But, if we send just one command, it will read it directly. It does not wait 75% of the buffer. I am searching for the loop, where it wait to reach the 75% of the buffer, and I didn't find it.
I don't understand realy what does it do, when we send a complete Gcode through Pronterface. Please help me

I don't know where the 75% comes from, and I am not sure exactly what you are trying to find out.

However, the code is quite straightforward. BUFSIZE is the size of the unparsed line buffer "cmdbuffer". BLOCK_BUFFER_SIZE is the size of the movement block queue "block_buffer". Of course, not all Gcode commands result in a move.

get_command() reads the next command, either from serial or the SD card. In the case of G1, plan_buffer_line() will be called to place the move into the block buffer. if the buffer is full, that function loops until there is space. The stepper module frees blocks when they are finished by calling plan_discard_current_block().

Marlin, like most other firmwares, blocks comms when the move buffer is full. It doesn't have to be that way, it's quite easy to code it differently and you don't need a real time OS to do it, but that is the way they are.

Edited 1 time(s). Last edit at 11/08/2013 04:25PM by bobc.


What is Open Source?
What is Open Source Hardware?
Open Source in a nutshell: the Four Freedoms
CC BY-NC is not an Open Source license
Re: BLOCK BUFFER SIZE, BUFSIZE and SD ramps!!
April 29, 2014 04:04AM
Hi bobc,

Sorry for the late reply. I worked on another thing than the Marlin!
Last week, I sew this part, and it seems exactly as you said!

plan_buffer_line() will be called to place the move into the block buffer.
plan_discard_current_block() remove the command when it is finished!!

All this function are in interruption on stepper.c

Thank you!!
Sorry, only registered users may post in this forum.

Click here to login