Need for SPI library using buffer and interrupt?

1 view
Skip to first unread message

rob...@hotmail.com

unread,
Jan 10, 2026, 7:10:13 AM (2 days ago) Jan 10
to jallist
Hello JAL users,

I have a question. We have USART libraries in two flavors:
1) Without a buffer, so during transmission you have to wait for the transmission to be completed before sending the next character.
2) With a buffer that sends all data from that buffer on an interrupt basis.

For SPI we only have option 1).

I was wondering if there is a need for a SPI version that offers the same functionality as 2). The advantage is that you can send data to the SPI interface in the background without your main program having to wait for each byte to be transmitted.

Please share me your thoughts on this.

Thanks.

Kind regards,

Rob

pinhe...@gmail.com

unread,
Jan 10, 2026, 1:38:53 PM (2 days ago) Jan 10
to jallist
Hi Rob,

(Happy new year to you and all Jal users)

Isn't that what the spi_master_hw lib does ?

Kr,

David 

--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jallist/59a10776-0e39-4eab-a6d9-baff375edf60n%40googlegroups.com.

pinhe...@gmail.com

unread,
Jan 10, 2026, 1:42:11 PM (2 days ago) Jan 10
to d.corle...@gmail.com, jallist
Or the spi_host_hw library  ?

Rob CJ

unread,
Jan 11, 2026, 3:16:54 AM (yesterday) Jan 11
to jal...@googlegroups.com
Hi David,

No, the current SPI libraries check if the SPI is busy and then the CPU waits before a new byte is transmitted.

With a version using a buffer that uses interrupts like in de USART version, e.g. serial_hw_int_cts.jal the SPI data is placed immediately in a buffer and is transmitted on an interrupt bassis so the CPU does not have to wait for it. Of course if the buffer is full then there the CPU still has to wait for a free space. The size of the buffer can be configured.

But maybe the use-case is not so relevant for SPI. In case of a USART, data can come-in at any time an then it is nice that data is buffered so the main program can determine when to process it. For SPI this would only be needed in case of SPI slave mode and I do not think that is used that often 

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens pinhe...@gmail.com <pinhe...@gmail.com>
Verzonden: zaterdag 10 januari 2026 19:42
Aan: pinhe...@gmail.com <d.corle...@gmail.com>; jallist <jal...@googlegroups.com>
Onderwerp: Re: [jallist] Need for SPI library using buffer and interrupt?
 

vasi vasi

unread,
6:26 AM (11 hours ago) 6:26 AM
to jal...@googlegroups.com
It is always good to have it, personally I do not need it "yet". Useful when you create devices that needs the speed (or the protocol) of an SPI peripheral...  Probably more attractive for the industrial zone.



--
Vasi
Reply all
Reply to author
Forward
0 new messages