|
Well,
When users encounter a library that doesn't work they tend to toss it into the bin and never look back. I'd recommend holding off a bit until you understand the nature of the timing issue.
Best Wishes,
-David Delaune
|
|
|
|
|
The suits say: "ship it, we need the money"
>64
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
I assume developers are consumers of your library.
My extremely naïve take on what you've described:
Can you not let those developers supply some sort of sleep value, and, if provided, use it, and if not, let 'er rip as fast as it can?
Then document the living crap out of it. Share the results from your test matrix, and let those developers make their own choices. Maybe supply "known good defaults" for different chips.
I realize I'm talking in very broad terms. But I'm very much aware of what happens when you become so intimately familiar with details that you lose sight of the broader picture. If that's a viable solution, go for that...
|
|
|
|
|
I actually considered that but the optimized code only works on one board I tried, and I'd at least like to try it on another of the same model to see if it's a fluke. With something like this, you never know.
Real programmers use butterflies
|
|
|
|
|
Reading the other replies, I think you might be rushing it. IMHO, it needs more testing. Knowing you, you will likely keep at it and finally have an 'aha' moment.
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
Yeah that's kind of where I'm at now too.
Real programmers use butterflies
|
|
|
|
|
What does your Marketing guy say?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I'm the only marketer. The product is free, but in use by people.
Real programmers use butterflies
|
|
|
|
|
Marketing is always overly optimistic.
Your question should be, if I release, will it make me look bad; and is that worse than being late; which is easier to fix.
If the simple version worked, I would have gotten simple to work, then added the advanced functions, in parallel, and turned off the others when the new ones worked.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I've already done that though. It doesn't fix it. Only when all optimizations are turned off does it all work. If I turn on any of the optimizations I wrote, it fails on certain devices.
However, the reference code I used, which contains these optimizations works on those devices.
Hence my problem.
Real programmers use butterflies
|
|
|
|
|
No. You shouldn't release some design when you know it malfunctions under some circumstances, especially when you don't know exactly when and why it does.
FYI: electronic devices have lots of detailed specs, things like minimum pulse width, minimum set-up time (data valid before clocked/latched), minimum hold time (data valid after clocked/latched), etc. It is up to the system designer to make sure each and every one of those requirements is met. As most of these specs are minimum values, optimizing code can easily cause the timing requirements being violated. NOP instructions are not uncommon in low-level code, and then "smart" tools should be kept from eliminating them...
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
I was talking about taking the optimizations out. But anyway I don't think I'm going to release it without them. I'll get it working first.
As far as your FYI, yeah, I'll use my logic analyzer and datasheets if it comes to that, but that's a last resort. To say it's laborious is a huge understatement.
Real programmers use butterflies
|
|
|
|
|
You don't need a logic analyzer, you don't even need a scope, to get timing specs right. You should get them right by design, not by inspection.
You do need the data sheets of the components involved. Taking care of setup and hold times is the first thing you should do, they are a crucial part of the contract you have with the chip vendor. A data sheet is a unilateral contract, there is no way around it.
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
The problem with that is simply effort. Basically I'd need to know the timings for absolutely everything. It would take me months to write code that should take me days. I think I'll pass.
Real programmers use butterflies
|
|
|
|
|
That is overly pessimistic. Systems get designed without knowing "everything". What you do need is a basic approach to the setup-and-hold issue; so you need to make sure
A) data transfers don't overlap
B) each data transfer consists of three phases:
1. set the data ready
2. issue the clock/latch pulse
3. remove the data (i.e. guarantee the hold spec)
These steps must remain in sequence, with non-zero time between them. As electronic setup and hold requirements range in the (tens of) nanoseconds, having one or a few instructions in between normally suffices. How you get that depends on environment and available tooling.
If a general purpose driver is present, consider using three separate I/O operations. If a specialized driver is used, it should take care of the details itself.
Once you get a solution, use it everywhere. Separation of concerns applies at all levels.
PS: Beware of optimizing compilers; low-level code best is collected in a separate file that gets handled with other tools or tool settings.
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
This is all an excellent argument for using my logic analyzer.
Real programmers use butterflies
|
|
|
|
|
That does not make any sense to me; it sounds like using a debugger when code does not even compile.
BTW: a logic analyzer also has setup and hold requirements!
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
Okay.
I don't time the SPI in software. It is timed by a controller on the MCU I'm using.
No compiler in the world is going to tell me what that hardware is producing.
A logic analyzer will.
So if I want to make sure the signals don't overlap, I'm looking at the bus output using my salae. Full stop.
Real programmers use butterflies
|
|
|
|
|
Displays have their own requirements, no matter what bus or interface is being used. Their functionality typically is microcontroller based, and simple commands take a few microseconds to process; more complex commands (total reset, return home, row clear, ...) may run into a few milliseconds. Obviously you have to take care of that, SPI or any other interface won't do it for you.
If you want to debug that with an LA, be my guest. My first approach would be to add some code to either check things by software (assert minimum timespan between commands) or generate a log file; yes I'm aware this by itself may change the timing a bit, however it can tell me where things are insufficient or marginal.
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
Luc Pattyn wrote: My first approach would be to add some code to either check things by software (assert minimum timespan between commands)
And which display model and chip should I start with since the same exact thing (including exactly how it fails) happens on literally all of them. ST7789, ILI9341, and SSD1351 alike.
So which datasheet do I start with? Since they all fail exactly the same way?
Real programmers use butterflies
|
|
|
|
|
If you want all of them to work properly, it does not really matter, you would have to solve all problems anyway. But then ST7789S and ILI9341 look very similar, while SSD1351 is clearly different.
Assuming nothing else is a factor (e.g. all hardware looks equally reliable) I would start with ST7789S or ILI9341, whichever you get the most recent datasheet for. Or the most intelligible one, as not all Asian-to-English translations are equally successful.
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
Since you're asking for opinion: You seem to be a very creative person, so I'm guessing that you have ideas bubbling away on the back burner of your mind all the time. Back burner this one. Let it rest from up-front work while you work on other projects, and the answer might just hit you along the way.
|
|
|
|
|
1. Optimised code that does not work is not optimised code.. it's broken code.
2. Get on and fix it - use a good LA to look at timing and data value differences on the bus of when it works/compared to not working.
3. Do not release known broken code.
4. Consider people asking to use DMA....
|
|
|
|
|
I don't like it when people are pedantic. You know what I mean in #1.
The DMA is actually the only part that's working consistently.
Real programmers use butterflies
|
|
|
|
|
Yes I do know what you mean. But the point is consumers of your library will not know (or really care?) about the history of the code, they just want to use code that works and is good quality. If perhaps you change the wording and asked if consumers would like un-optimised code or broken code, neither sound all that appealing.
|
|
|
|