SmallBASIC was ported to the Teensy 4.0 and 4.1. Have fun using SB on this fast and easy to use microcontroller. For details see our Teensy guide.
What is the size of the Tx and Rx buffers for serial Comms? Is there a road-map for this development (features, capabilities, etc)? I’m gonna have to get one ![]()
![]()
I don’t have a real roadmap, but I would like to implement the following features (in this order, somehow)
- LittleFS for storing the SmallBASIC program and data in flash memory. Run the stored SB program at Teensy startup
- Accessing SD card from your SB program
- SPI → many displays
- OneWire → i.e. Dallas temperature sensor DS18B20
- Examples for more I2C devices
Here are some information about Rx and Tx buffer:
- USB serial: in principal a huge buffer managed by the operating system and the Teensy usb core: Teensyduino: Using USB Serial with Teensy on the Arduino IDE
- Hardware UARTS (serial 1 to 8): 64 Bytes software buffer. Can be increased with
Increasing buffer size for Teensy 4.1 | Teensy ForumSerial6.addMemoryForRead(serial6RXbuffer, SERIAL6_RX_BUFFER_SIZE)); Serial6.addMemoryForWrite(serial6TXbuffer, SERIAL6_TX_BUFFER_SIZE);
Let me know if you really need this feature.
If you have other ideas what to implement, let us know.
64 bytes/port is good for me.
Presumably, changing the PWM resolution is already planned?
There is a library; HardwareQuadratureDecoder which handles multiple high speed encoders without CPU overhead. I don’t suppose it would be a simple matter of creating a wrapper?
I see that the 4.1 can handle ethernet. Any plans for this?
Will there be a hardware (deterministic) timer interrupt?
This is gonna be awesome
![]()
- PWM and changing PWM resolution is already implemented: SmallBASIC | teensy
- I can implement: Encoder Library, for Measuring Quadarature Encoded Position or Rotation Signals
- No plans for Ethernet yet.
Oh fantastic, can we also include:
We will have the basis of a full blown CNC that uses servo motors as opposed to steppers ![]()
![]()
![]()
The 1ms minimum loop time is OK but if we could get shorter than that, we will be with the big boys ![]()
Oh wait. That isn’t the high speed library, it uses interrupts.
This is the one that I was referring to:
#include <HardwareQuadratureDecoder.h>
HardwareQuadratureDecoder encoder1;
HardwareQuadratureDecoder encoder2;void setup() {
Serial.begin(115200);// Initialize two encoders on different pins encoder1.begin(2, 3); // Encoder 1 A and B pins encoder2.begin(4, 5); // Encoder 2 A and B pins}
void loop() {
int32_t count1 = encoder1.getCount();
int32_t count2 = encoder2.getCount();Serial.print("Encoder 1 Count: "); Serial.println(count1); Serial.print("Encoder 2 Count: "); Serial.println(count2); // Additional logic...}
It even supports Index and trigger signals…. Perfect ![]()
![]()
![]()
Interactive mode: Meaning that it’s possible to do things like interrogate and/or change the value of a variable during program execution? ![]()
![]()
oh, maybe the name is misleading. Interactive modes means, that you can upload a new program via serial whenever you want. SmallBASIC will detect the upload, stop the current program and start the newly uploaded one.