BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - darkjezter

Pages: 1 [2] 3
16
Discussion - EVE / Re: Isometric Projection
« on: June 01, 2020, 09:00:29 PM »
Sure thing.  Like I said, I'm using it to update a pong clone, so it's a very simple use case.

Perhaps worth mentioning, most of the examples of this style of rendering out there don't use texture distortion to achieve the effect.  At least not in its heyday during the 80s and 90s.  The only way this approach is currently streamlining anything for me, is the 3 surfaces shown in the screenshot all use a single 16x16 texture.  Though, it could also allow for things like perspective changes while still using the same texture set.

If this demo gets any traction around the office, perhaps I'll go ahead and implement a title screen further leveraging the effect.

17
Discussion - EVE / Isometric Projection
« on: May 29, 2020, 04:49:23 PM »
Greetings all!

I've been playing around with the bitmap distortion matrix and masking to produce an isometric pseudo-3d display using the EVE3.  It's still pretty raw, and while I've yet to boil it down to a library that takes care of the matrices and masks, I am getting some pretty impressive results using a single texture to create the effect.

I'm evaluating the approach by revamping a pong clone from black and white to something slightly more modern looking.

While there is certainly a cost in terms of setting up the stencil buffer state and manipulating the matrices, this approach appears to exercise the EVE3 where it shines.

In theory, similar techniques could be used to produce more aggressive 3d texturing, however all bitmap distortion is limited to affine projections thus producing a result comparable to to first-gen Playstation.  I likely won't bother exploring that due to the amount of stencil manipulation required to split any quads into two affine textured triangles, and the somewhat ugly result that the non-perspective distortion would result in.

Has anyone else here played with the bitmap distortion to achieve this or similar effects?

Cheers!

18
Discussion - EVE / Re: The Christmas list for BT82X
« on: November 20, 2019, 07:49:44 PM »
Based on my own experiences with the BT816:

Control over built-in widget theming (drop shadow on fonts, 3d edges/corners, etc)

Ability to sidestep RAM_DL contention.  This one is a bit open-ended, but in a nutshell, RAM_DL is used both for preparing a new display list (and thus becomes unavailable when a swap is pending), and also for the construction of co-processor widgets.  This is the only case where I've found any issues overrunning the command FIFO.  The most powerful solution would be allowing the coprocessor to target an arbitrary RAM_G location for widget construction, however I have also explored aborting pending swap requests if the commands queued in RAM_CMD are no longer required.

Resistive touchscreen pressure measurement fixes.  After digging into an issue where the touchscreen reports touch events that do not correspond to actual events I found that the pressure measurement will successfully report a touch pressure when the analog measurement never settled during the measurement interval.  As pressure is the only configurable threshold to distinguish between touch and no-touch events, this leads to pressure thresholds that must be far less sensitive then the hardware would actually allow.  This issue allows X&Y coordinates that deviate from actual points of touch to be reported by the EVE in the case where the pressure measurement failed to stabilize.  Making use of the existing oversampling parameter to determine if the measurement did in fact settle to a valid reading would greatly improve this chip's touch reporting.

I can probably come up with some more suggestions, but I would have to say these are my big 3.

Cheers!

19
Discussion - EVE / Re: Styling 3D control Shadow effects
« on: November 08, 2019, 05:02:38 PM »
Yes, the shadow/highlight effect on text in the widgets.

In particular, setting a font color of black causes the text to look smeared due to the shadow color matching the font color.

20
Discussion - EVE / Styling 3D control Shadow effects
« on: November 06, 2019, 03:06:33 PM »
Hey all,

I've been over the doc and have been playing with both the current FG color, as well as the control color commands, but haven't found any way to change the appearance of the drop shadows used in 3D controls.

In particular, we're evaluating a black on white theme, however the drop shadow on text in 3D controls remains black causing black text to appear smeared along the shadow axis.  Is there any way to change the colors used for these effects without abandoning the 3D look or built in controls?

Cheers!

21
Discussion - EVE / Re: BT816 - Resistive Touch Threshold
« on: September 25, 2019, 06:08:52 PM »
Sure enough... after decoupling the display and touch timing in my own code, changing the touch mode to continuous does now show the threshold being enforced.

Any reason this appears not to work when running touch in frame mode?

22
Discussion - EVE / BT816 - Resistive Touch Threshold
« on: September 25, 2019, 04:18:42 PM »
I'm currently digging into the resistive touch support of the 816 series and having an issue with the REG_TOUCH_RZTHRESH setting.

No matter what I set this threshold to, the EVE is still reporting all touches even for cases where REG_TOUCH_RZ reports a value larger than the set threshold.  This includes REG_SCREEN_XY, REG_TOUCH_TAG_XY, REG_TOUCH_TAG, REG_TOUCH_RAW_XY, etc.

The address I'm getting for this register from the doc is 0x302118, and I've tried reverting all touch-related configuration to default in trying to get this setting to work.  The only setting I haven't changed back to default is REG_TOUCH_MODE which I currently need to be set to 2 (frame mode)  I've also attempted setting the threshold earlier in the power-on initialization process to no avail.

I've read of other people's success using this setting to adjust the sensitivity, but am coming up with nothing myself.  Any insight would be greatly appreciated.

23
Discussion - EVE / Re: Abort pending swap
« on: September 03, 2019, 06:12:03 PM »
As those suggested state machines will need to be duplicated or extended for each of the existing screens (again, legacy software migration), this is a solution that would require completely restructuring the existing codebase.  That is one of the things on my todo list, however, it will not be done to work around the EVE chip's swap behavior.

In the end, this will likely move to a co-processor command buffer managed on the MCU, using DMA to feed the FIFO.  Using the self-modifying command stream I mentioned in another thread, this can at least be built in MCU RAM without waiting on completion by the co-processor, or guessing at the resulting display list snippet sizes.

As stated earlier, my concern is not delays in updating the display, it's managing the SPI communication time.  The transfer times are fine as they are, up until the FIFO overflows due to RAM_DL contention.

The other ways I see this issue being managed are:
  • Moving screen initialization logic into each screen's event loop, waiting for the last swap request to be completed before initializing the new screen.  This would allow the automation logic to still execute if the FIFO was at risk of overrun, and is a much more conservative change to the existing code.
  • Build the entire screen-initialization command list in RAM_G, and feed the FIFO from there.  This would have the advantage of shifting the RAM burden to the EVE, which has a much larger capacity than the MCU.  It also would prevent the FIFO from filling, as CMD_DLSTART would be cached in RAM_G along with the reset of the new-screen initialization.
  • Abandon the co-processor widgets and build new screens directly in RAM_G

I'm a bit surprised that the with the contention around RAM_DL and suggested swap behavior which exacerbates this contention that there is no way to either track the scanout progress, or to abort pending operations to make the co-processor available.  Either of these would allow the cost of a pending swap to be managed. 

In the meantime, writing zero to the REG_DLSWAP register is giving me exactly the behavior I'm looking for until I either A: encounter the 'unpredictable-behavior' mentioned, or B: proactively migrate to a MCU command buffer and DMA.

24
Discussion - EVE / Re: Abort pending swap
« on: August 29, 2019, 04:19:48 PM »
The issue arises from the contention around RAM_DL when using co-processor widgets.

Suppose we have a simple case of a screen with a large amount of static content which is populated once as the screen is activated.  In addition to the static content, there is dynamic content which is updated once per frame by tracking when CMD_SWAP has been sent, and when the swap interrupt has been triggered.  To avoid blocking and overflowing the FIFO, these updates are suppressed until the SWAP interrupt occurs.  This works well, ensures there is only one swap holding up the FIFO at a time, and generally results in the FIFO being nearly empty.

Now, suppose a different screen needs to be displayed, with a similar bulk of static content populated during initialization.  Also that it's triggered in response to some error or other event that is not-related to the UI of the previous screen.  The update to the previous screen and the request to swap now prevent the FIFO from being emptied by the co-processor for up to a full frame interval.

The path that led me to this question, was trying to invalidate the updates to the previous screen so that the new screen could be constructed without waiting the frame interval.  I don't need the new screen to be displayed immediately, I simply want predictable data-transfer times across SPI to the EVE.

Quote
You can probably do the maths given the display parameters of the screen you are using the PCLK frequency being used
Am I correct in understanding that your suggestion here is to track the timing of when the previous swap interrupt occurred, and suppress future swap requests until some fraction of the frame interval expires?

If that's the case, I hope you can appreciate why I'd seek to exhaust alternatives like cancelling a swap and/or resetting the co-processor.

25
Discussion - EVE / Re: Abort pending swap
« on: August 28, 2019, 04:22:04 PM »
Very well then.

Is there any other alternative which doesn't require switching to line swap?

I see no way to determine when a frame is nearing completion (no register showing the current vertical position in scanout).  Heck, the only way I can see to switch from a frame-swap to a line-swap is by replacing CMD_SWAP with CMD_MEMWRITE.

Is there perhaps a way to abort all pending operations and begin populating the command FIFO in less than the frame interval?

Cheers!

26
Discussion - EVE / Clear the co-processor command fifo
« on: August 27, 2019, 04:37:14 PM »
Greetings all!

Related to my other post on aborting a pending swap operation, I'm also seeking to clear the co-processor's command fifo.

Based on the "Coprocessor Faults" section of the programming guide, and my assumption that writing to REG_CMD_READ during co-processor execution would likely lead to state issues, I first attempted a reset similar to the recovery steps listed in the guide.  This however led to large portions of the screen not being displayed correctly.  Assuming that I was trying to feed the FIFO too early in the co-processor's initialization following reset, I had inserted delays following the reset as a test, but saw no change in observed behavior.

What appears to work reliably is simply copying the contents of REG_CMD_WRITE to REG_CMD_READ.  Upon doing this, I am seeing the INT_CMDEMPTY interrupt asserted, and correct 0xFFC reported by REG_CMDB_SPACE.  I'm skeptical that this is the safest way to proceed, but have otherwise been unable to use REG_CPURESET for this purpose.

My chief concern with clearing the fifo with the x_WRITE to x_READ copy, is what happens if the co-processor is part way through processing a multi-word command.  Would it still be expecting parameters to follow?  This smells like a race condition waiting to happen.

Any feedback on this approach, or suggestions on what to do instead?

** Side note regarding REG_COPRO_PATCH_PTR: I'm seeing conflicting info on properly using this register during the reset.  According to the register definition, this is a 16-bit read-only register, however the matrix orbital github code is using 32-bit operations on it.  During my tests, I've tried both sizes, and even omitting the patch pointer write from the reset.  All 3 of these cases gave me the same result.

Many thanks!

27
Discussion - EVE / Abort pending swap
« on: August 27, 2019, 03:24:57 PM »
Hey all,

Perhaps this is a question for the Bridgetek folks, but I'm looking for a way to rapidly cancel pending operations and first up is the frame-swap if one has been scheduled.

I've found that the swap can be aborted allowing dependent operations to proceed by writing a zero to REG_DLSWAP.  While my testing looks good, the documentation specifically states not to write 0 to this register.

I'm interested in using this to rapidly begin a new screen without waiting for the previous swap (and corresponding CMD_DLSTART) to complete.  Any specific reason this particular operation is specifically prohibited in the doc?

28
Discussion - EVE / Re: EVE3 - Asynchronous display-list updates
« on: August 21, 2019, 03:59:27 PM »
To add... you're right about the frame interval and time to update the display.  17ms is more than enough time to rebuild the entire display, in my own setup, an entire 8K list could be sent in about 2ms without even using the co-processor widgets.  However, doing so would occupy the MCU for that duration, and due to the realtime monitoring and control of our robotics platform this is a significant time slice, which would be taken up by code ideally 'hidden' in the UI framework.  There are other ways that cost can be managed, but as EVE is the new-player in our platform, I sought a solution that could be isolated to the code handling EVE interaction.

After getting this solution together and getting some actual time measurements along with your criticism, I'm comfortable acknowledging that the chip is fast enough where this trick probably isn't necessary for most projects.  Especially in the case where it's a project starting from zero with EVE integrated.  For our purposes, I wanted to build a library that will be integrated into several real-time projects, allow us to provide a consistent UI and do so while these implementation details have as small an impact those projects as possible.

Time to update the display aside, this also leads to code where all display snippets are built and tracked by the EVE.  The MCU doesn't need to know what the resulting sizes are, and aside from minor state updates and touchscreen events, virtually all data flow is one-directional, with no EVE->MCU flow of data that may require waiting.  Maybe it's a small thing, but, IMO it makes for a much cleaner implementation, and one that lends itself better to being later adapted to buffering on the MCU side.

29
Discussion - EVE / Re: EVE3 - Asynchronous display-list updates
« on: August 20, 2019, 07:39:11 PM »
Hey Rudolph, first off I'd like to thank you for engaging whether or not this trick is necessary or even useful.

The main problem this is meant to solve is prediction of the size of a snippet produced by a series of co-processor commands, or in my case, by higher-level API calls which make use of widgets plus our own display elements.  In the source code you linked earlier, you're building a snippet once during initialization, and getting the size upon completion.  This works well enough for static snippets, but generalizing this approach to snippets that are updated between frames requires synchronization between the EVE and MCU.

Writing the snippets direct to RAM_G as you mentioned would avoid the problem of RAM_DL contention, but as you point out, introduce a new problem of ensuring that the snippets are not modified during the CMD_APPEND calls.  Though, this problem is simply mitigated by double-buffering the snippets on update.  Moot point though, as this is not an option provided by the co-processor.

Pre-calculating multiple states of snippets, and appending the desired one based on MCU state is the closest to what I sought out to accomplish.  The main issue here becomes that the API I'm building has more than two states per button as we also allow non-touch navigation using a d-pad.  With a highlight state added to support the d-pad the number of per-button states increases from two to four, and quickly becomes impractical should other states be added.  In our use-case, we also use different colors/blinking to indicate other state through the appearance of the buttons.

Re-issuing all the draw commands each frame where the screen is updated is probably the safest workaround.  I'll admit, the main reason I didn't pursue this method is that we have some screens where very little changes per frame, and others where most of the screen content is dynamic (mostly text, but not all).  Again, the goal is to provide a consistent API that handles these two cases in a uniform way.  Also, in the case of text, the most SPI traffic efficient way to update a large number of text fields is using CMD_TEXT, provided the text strings are more than a few characters.  Obviously, this is no longer true if the screen content is static and can be loaded to flash ahead of time.

With regards to allocating enough space for worst case size, that's exactly what I'm doing.  But due to the desire to save these snippets to ram, and the structure of the append command, the actual size of the snippet is still required.  It is required both for the copy to RAM_DL, and for the corresponding CMD_APPEND.

The primary advantage of this approach is the number of snippets can be arbitrarily large, with no impact on the amount of SPI traffic.  In essence, it allows arbitrary granularity on how many elements are updated as a batch or snippet.  Managing worst case performance can then be tackled by splitting larger snippets into smaller ones, updated less often.  The commands sent by the MCU do not change regardless of how many snippets are created.

Perhaps your constraints aren't the same as the ones I'm managing in my own work?

For what it's worth, developing this trick and dealing with the FIFO wraparound didn't take much time at all.

Cheers!

30
Discussion - EVE / Re: EVE3 - Asynchronous display-list updates
« on: August 15, 2019, 08:56:14 PM »
Before going down this road, the first thing I did was examine the RAM_DL behavior around swap.  It was interesting, but suggested that much of our legacy code would require a full rewrite to migrate to EVE.  Yes, the display updates are asynchronous already, but building display lists in RAM_G using the co-processor, and subsequently appending them for display is not without this technique.  At least, not as far as I can tell.

Co-processor widgets can only be built in RAM_DL, and if a swap is pending then those widget commands will wait in the FIFO until the RAM_DL becomes available.  This implies that new display list block sizes may not be known for up to a full frame interval, so instead of having the MCU pull these block sizes from the EVE, the EVE builds the series of append commands right in RAM_G, which it can then copy into the FIFO and execute without added support by the MCU.  This approach was preferable to either reverse engineering the list sizes produced by the co-processor, or ignoring the widgets and building the display lists directly increasing the amount of SPI traffic.

What this allowed for is to separate the display list into an arbitrary number of independently updated blocks.  From the MCU side, the necessary blocks are updated, and then queued for assembly and display.  The only data the MCU needs to read out to set this all up is REG_CMDB_WRITE, the rest is manipulated by the EVE as it executes the contents of the FIFO.

The only issue I've encountered with this approach is that CMD_MEMxxx commands do not wrap around within the command FIFO like SPI transfers do.  Not entirely unexpected I'm sure, but does require some care when telling the EVE to manipulate the contents of it's own fifo.

While I have found the doc on macro and append, and did look at the PIC library examples, nowhere did I see any examples of using the EVE's co-processor commands to manipulate the command FIFO.  Effectively, this technique relies on building the append list in RAM_G, self-modifying code fed into the FIFO, and feeding the FIFO with the contents of RAM_G.  If there are any examples of these 3 techniques being used anywhere in the doc, I'd love to see them.

The two pushes that led me to explore this approach were porting legacy UI code, and keeping the MCU available to handle the real-time control of our robotic platform.  Using the described technique, the EVE has become an asset, allowing for simpler migration and better runtime performance than we had with our black and white LCDs we're replacing.

It's a success story in progress, and I guess I just wanted to share.

Pages: 1 [2] 3