Search results

  1. JarkkoL

    Optimal ILI9488 Setup? What is the best hardware to use for a robust system?

    I released a low level graphics library awhile ago which uses tile based rendering and transfers only the updated areas to the display. There's also a speedometer example with code, which renders a textured needle over a textured background. The library has also support for ILI9488 display.
  2. JarkkoL

    Help me optimise this code

    I don't think you give CM7 the credit it deserves regarding branch prediction, which coupled with dual-issue pipe enables zero cost loops. Not sure how you managed to miss it while reading those articles. Fixed size loop in particular is a very simple case for any branch predictor. I don't find...
  3. JarkkoL

    Help me optimise this code

    The looping adds extra work for the processor but it doesn't necessarily add extra cost because ILP - there's a difference, and the cost is what we care about not work. Here's a good explanation what that means...
  4. JarkkoL

    Help me optimise this code

    Teensy 4 seems to have branch prediction and also much bigger cache than Teensy LC for example. If you expand the code size by unrolling, the MCU has to be fetching the code from flash more frequently slowing things down due to the memory latency. It obviously depends a lot on the case what the...
  5. JarkkoL

    Help me optimise this code

    Yeah, but that statement has no side-effect (i.e. does nothing). Should have "max=std::max(max, 10.0f);" to clamp the <10.0f values to 10.0f For unrolling, did you have fixed loop count for your test or did you use the "i<m_signalLength" condition as in your original code? Because if you would...
  6. JarkkoL

    Help me optimise this code

    Ok, there's a bug in the code, where you should assign std::max() result to max. Depending on the architecture the loop unrolling may actually hurt performance in terms of instruction cache misses and because some architectures got branch prediction to make loop branching practically free. Not...
  7. JarkkoL

    Help me optimise this code

    Ah, didn't see. Can you show what's the current optimized version?
  8. JarkkoL

    Help me optimise this code

    You could remove the second loop in NormalizeSignal() and just return the max, then perform the normalization while calculating the abs delta in ComputeManhattan().
  9. JarkkoL

    What's a better way of doing this? avoiding iso c++ compiler warnings

    You are on the good road of trying to fix warnings because they are potential sources of bugs in the code :) You can even use a compiler flag to report warnings as errors ("-Werror" for GCC) to enforce fixing warnings. There is also different level of warning checks that can be enabled and using...
  10. JarkkoL

    EmberGL: 2D/3D Graphics Library Release

    Hi! I just released a 2D/3D graphics library EmberGL in GitHub and which should also be available via the Arduino IDE soon: https://github.com/EmberGL-org/EmberGL. It's a low-level graphics library featuring a tiled software rasterizer and couple of optimized display drivers for ILI9341 &...
  11. JarkkoL

    Resetting millis() - again

    I believe the reason why you should never reset the global timer is because other libraries likely assume that the time goes forward, so breaking this assumption likely causes a world of trouble. What you should do instead is to keep your own timer and keep updating it with the delta time...
  12. JarkkoL

    Interest in 3D graphics lib?

    Got the aforementioned examples created for the library and here's a Youtube playlist of them running on Teensy & ILI9341. Hopefully can get the library released by the end of the year :) Cheers, Jarkko
  13. JarkkoL

    #define that can evaluate?

    You can define the macro as: #define MAP(pin,targetbit) (((REGISTER(pin) >> BITSH(pin)) & 1) << targetbit) and the compiler will optimize the shifts for you as long as these BITSH() and targetbit are constant expressions.
  14. JarkkoL

    Tiniest Teensy-based projects?

    Emphasis on description but thanks for digging out the info PaulS, that's tiny :)
  15. JarkkoL

    Tiniest Teensy-based projects?

    Very cool, thanks for the link Paul. Did anything come out of this miniaturization project? The MicroMod Teensy you mentioned in the discussion looks cool too. Weird they don't actually mention the dimensions in the description since that's a big selling point, but looks tiny :) And the cash...
  16. JarkkoL

    Tiniest Teensy-based projects?

    Hi, I'm curious, if you start a project by prototyping with Teensy 4.x, and then got a product you want to actually manufacture based on this prototype, how tiny & cheap can you make it (including a power source)? I'm just wondering about the ballpark figure. Like you'll need Cortex-M7 chip +...
  17. JarkkoL

    Best method for managing multiple tasks?

    You can also do co-operative multitasking with fibers. Here's my fiber lib: https://github.com/JarkkoPFC/fiber Cheers, Jarkko
  18. JarkkoL

    Interest in 3D graphics lib?

    Got the first 4 examples implemented :D
  19. JarkkoL

    Anyone mind looking over my schematic and seeing if I’ve set things up correctly?

    Yeah, here's HW hookup in Sparkfun: https://learn.sparkfun.com/tutorials/apa102-addressable-led-hookup-guide/all#hardware-hookup
  20. JarkkoL

    Anyone mind looking over my schematic and seeing if I’ve set things up correctly?

    Hmh, why are you upping the control voltage to 5V? Isn't it only the VCC of the LEDs that needs to be 5V while the control signals should be 3.3V?
  21. JarkkoL

    Interest in 3D graphics lib?

    Oh yeah, I saw your lib! It's the only other lib I have seen with comparable set of features :) I hope these will help push 3D graphics adoption to MCUs :D
  22. JarkkoL

    Interest in 3D graphics lib?

    These are actually unit tests to guard against library regressions and not the examples. The list of the actual examples I have been thinking: Graphics device initialization & colored rectangle rendering (shows how to setup the hardware and pick the accompanying driver + use the simple...
  23. JarkkoL

    Interest in 3D graphics lib?

    Been working on the lib to fix issues, improve the API, writing doc, etc. Amongst other things writing some unit tests for the library and got the first few running shown below :D
  24. JarkkoL

    Fast way to set digital pins on 3.6

    Thanks Kurt, I'll check out those registers. Seems like I should be able to use port B since it controls 16 pins, so I can use a single port for my 16bit parallel interface. To support 8bit interface (i.e. partial pins of the port) with PDOR I guess I could use cli/sti to deal with the data...
  25. JarkkoL

    Interest in 3D graphics lib?

    Got the first connector boards soldered and running, and now testing different MCU-display combos is as easy as swapping graphics card on PC :) Nice thing is that I need only one of each MCU and display, and can also detach them from the connector boards to put on breadboard to figure out the...
  26. JarkkoL

    Fast way to set digital pins on 3.6

    Hi, Is there any way to set multiple digital pins at once on Teensy 3.6 like there is on Teensy 4.x? portOutputRegister() seems to return different address for each pin and digitalPinToBitMask() return 1 for all. I guess that means no? Thanks, Jarkko
  27. JarkkoL

    Interest in 3D graphics lib?

    Below is the interface design I'm thinking of. Should handle SPI/Parallel up to 16bit + some NC pins for extensions later.
  28. JarkkoL

    Interest in 3D graphics lib?

    Thanks for the tips Michael! I have these 6 displays and 3 Teensys (LC, 3.6 and 4.0) so far, so quite a bit of combos already :) These are connected to 36 pin connector boards but I haven't figured out the pin layout for the connectors yet. Some displays use SPI while others have parallel data...
  29. JarkkoL

    Interest in 3D graphics lib?

    Oh yes, I'll add this as well. People have also asked about the gauge sample so that would probably be a good addition too and to show that it's not only 3D but you can do 2D too. Maybe also the super memory optimized sample too which enables 3D rendering on Teensy LC. Finally got the samples...
  30. JarkkoL

    Interest in 3D graphics lib?

    I have created 3 examples so far to get started using the lib: 1) Init the device and draw a rectangle on the screen 2) Render a cube 3) Render a textured cube Any other ideas for examples you would like to see? :)
  31. JarkkoL

    Interest in 3D graphics lib?

    Cool, very nice to hear there's interest for 3D graphics in the MCU community! :o I haven't really seen that many 3D projects running on MCUs. Here's the current feature list of the lib: Configurable tile-based rasterizer (can be configured to run in very tight memory budget, e.g. 4.5kb...
  32. JarkkoL

    Interest in 3D graphics lib?

    Hi, Couple of years ago I posted some videos about a 3D rendering project I was doing on Teensy. Finally I have decided to start to work on publishing the library and was wondering if there's any interest in this community for such a thing? Or if you have some suggestions, questions, etc to...
  33. JarkkoL

    Arduino Music Player

    Thanks for the kind feedback and glad you like it :) Looks good and it's awesome to see the player used in cool projects like this! Cheers, Jarkko
  34. JarkkoL

    3D Rendering on Teensy

    Finally got my order of few different SPI & parallel interface LCD's from China for porting the renderer to :D Designed unified 26pin interface to quickly swap MCU's & LCD's 1.3", 240x240, SPI, ST7789 3.5", 480x320, SPI, ILI9488 4", 480x320, SPI, ST7796S 5", 800x480, 16bit parallel, SSD1963...
  35. JarkkoL

    Time for a new Audiolibrary

    Doing linear interpolation for my music player to be able to play multiple simultaneous instruments at different frequencies. If I were to implement an audio library, I would design it to be output device sampling rate independent. For example this music player isn't fixed to a single output...
  36. JarkkoL

    3D Rendering on Teensy

    Yes, I was in the PC demoscene in the 90's, but never got around to write a triangle rasterizer back in the days :D
  37. JarkkoL

    meaning of "with LTO"

    You can check for example this post about compiler memory access reordering: https://preshing.com/20120625/memory-ordering-at-compile-time/ The scope of local variables isn't the crux here, but the flexibility of memory access reordering during compilation while maintaining "the behavior of a...
  38. JarkkoL

    meaning of "with LTO"

    You don't need to make all the variables used by the interrupt function volatile, just the ones shared between interrupt function and the main loop. Anyway, it doesn't hurt the validity of the program, only the performance. And sorry about the confusion with "another interrupt". I meant the same...
  39. JarkkoL

    3D Rendering on Teensy

    Added bilinear texture sampling support for smoother texturing :) In the video it's toggling between point and bilinear sampling to show the difference. I'm currently supporting 23 different texture formats, so it required some template code magic to avoid code redundancy while having fairly...
  40. JarkkoL

    meaning of "with LTO"

    To give a bit more context, consider the following innocent looking code: static uint8_t s_buffer[256]; // interrupt fills the ring buffer with data static uint8_t s_buffer_pos; // interrupt updates the buffer position static uint8_t s_interrupt_triggered; // interrupt sets to 1 when it...
  41. JarkkoL

    meaning of "with LTO"

    Without seeing the code it's difficult to tell, but based on your description, the reason could be buggy code how you communicate between interrupt routine and the main loop. Remember that interrupts may happen anywhere in the main loop if you don't disable them, so if for example you happen to...
  42. JarkkoL

    ILI9488_t3 - Support for the ILI9488 on T3.x and beyond...

    What I do with images, is to save them in png/jpg/etc from Photoshop and have a command line tool to convert the file to .h in given format.
  43. JarkkoL

    3D Rendering on Teensy

    Ah yes, I think I could make proto boards for each display which maps from the display pins to some standard pin setup, and then another set of proto boards for each MCU to map from that standard pin setup to the MCU pins. This way I could swap MCU's and displays around without worrying about...
  44. JarkkoL

    3D Rendering on Teensy

    I'm thinking of buying these 3 displays and porting the lib to them: - 5" 800x480, 24bpp, SSD1963, 16bit parallel bus - 4" 320x480, 16bpp, ST7796S, 8/16bit parallel bus - 4" 320x480, 16bpp, ST7796S, 4-wire SPI However, what would be a good way to connect the 40/34 pin connectors in the first two...
  45. JarkkoL

    ILI9488_t3 - Support for the ILI9488 on T3.x and beyond...

    I got this 3.5" 480x320 TFT working with Teensy 4.0. It's 8-bit parallel though not SPI.
  46. JarkkoL

    3D Rendering on Teensy

    Here's a video about meshlet Hi-Z occlusion culling I added to the rasterizer. The occlusion culling is able to eliminate parts of the model as they are occluded by other models prior to any vertex and pixel processing thus reducing the rendering cost. In the video, when the bunny model dips...
  47. JarkkoL

    3D Rendering on Teensy

    Thanks! I have thought of releasing the lib with samples like the speedometer, but I got quite a bit of work to get there.
  48. JarkkoL

    3D Rendering on Teensy

    Squeezed the 3D lib to run on Teensy LC, not so flashy but it works! :D - Consumes 4.5kb of RAM - Uses 32x32 pixel tiles (8-bit grayscale frame buffer, 8-bit depth buffer) - 128 triangles, 64 vertices I'm using the standard Arduino SPI interface, which is pretty slow. Not sure if there's more...
  49. JarkkoL

    3D Rendering on Teensy

    Going higher res and ported the 3D lib to this cheap 3.5" Kuman ILI9488 320x480 display w/ 8-bit parallel data interface :D On this display I was able get 49fps fullscreen color fill on Teensy 4.0. It's advertised as a pin compatible Uno/Mega display, but it was quite easy to get it working on...
  50. JarkkoL

    ILI9341 CAN Display - Gauge rendering on display

    @mikey.antonakakis It's all good, but you shouldn't use floats or you'll end up having float rounding issues. i.e. over time the average will drift away from the real average of the values. Convert to use fixed point instead and just maintain sum of the values, and divide by the total number of...
Back
Top