FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: Dual FT813 emulation  (Read 12755 times)

uTasker

  • Newbie
  • *
  • Posts: 7
    • View Profile
Dual FT813 emulation
« on: October 01, 2019, 09:25:32 PM »

Hi

We have used the FT8xx emulation for a number of product developments but now have a new design that uses two FT813s.
Is it possible to use the emulation for two LCDs at the same time? Presently it looks like it can only support being started a single time and the interface routines have no reference to a particular instance (which would presumably be necessary to allow it).

Any possibility?

Regards

Mark
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Re: Dual FT813 emulation
« Reply #1 on: October 02, 2019, 03:18:48 PM »

Hello,

Unfortunately it is not possible at this time to emulate two LCDs concurrently.
But I will pass this on to the development team for their consideration.

Best Regards,
FTDI Community.
Logged

uTasker

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Dual FT813 emulation
« Reply #2 on: October 02, 2019, 04:10:42 PM »

Hi

I have just switched to the BT8XXX emulator (from FT8XXX) and it supports "emulator" instances it seems.
I can create two threads, each with its own screen being displayed.

Eg.
Code: [Select]
__declspec(dllimport) extern unsigned char (*FT8XXEMU_transfer)(unsigned char data);becomes
Code: [Select]
__declspec(dllimport) extern unsigned char BT8XXEMU_transfer(BT8XXEMU_Emulator *emulator, unsigned char data);
so it may be possible to control two by passing the appropriate
Code: [Select]
BT8XXEMU_Emulator pointer on each operation.

Presently I haven't been able to use the BT8XXX successfully for a single screen (it doesn't return 0x7c when the ID is requested - it returns 0x00 instead) whereby the FT8XXX version operates. However if I can solve that issue I will be able to see whether dual displays maybe operates....

Regards

Mark
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Re: Dual FT813 emulation
« Reply #3 on: October 04, 2019, 10:08:52 AM »

Hello,

So the development team have informed me that it is actually possible to emulate two screens at once.

They have provided the below initialization code:

Code: [Select]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                            BT8XXEMU_EmulatorParameters params;
                            BT8XXEMU_defaults(BT8XXEMU_VERSION_API, &params,
#if defined(BT815EMU_MODE)
                                            BT8XXEMU_EmulatorBT815
#elif defined(FT810EMU_MODE)
                                            BT8XXEMU_EmulatorFT810
#else
                                            BT8XXEMU_EmulatorFT801
#endif
                            );

                            params.Flags =
                                            BT8XXEMU_EmulatorEnableKeyboard
                                            | BT8XXEMU_EmulatorEnableMouse
                                            | BT8XXEMU_EmulatorEnableAudio
                                            | BT8XXEMU_EmulatorEnableDebugShortkeys
                                            | BT8XXEMU_EmulatorEnableCoprocessor
                                            | BT8XXEMU_EmulatorEnableGraphicsMultithread
                                            | BT8XXEMU_EmulatorEnableStdOut
                                            | BT8XXEMU_EmulatorEnableMainPerformance
                                            ;
                            params.UserContext = this;

#if defined(BT815EMU_MODE)
                            params.Flash = flash;
#endif

                            BT8XXEMU_run(BT8XXEMU_VERSION_API, &emulator, &params);
                           
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

     More code to implement the read/write EVE by passing the pointers of different instances:


                void swrbegin(size_t address)
                {
                                BT8XXEMU_chipSelect(emulator, 1);

                                BT8XXEMU_transfer(emulator, (2 << 6) | ((address >> 16) & 0x3F));
                                BT8XXEMU_transfer(emulator, (address >> 8) & 0xFF);
                                BT8XXEMU_transfer(emulator, address & 0xFF);
                                // BT8XXEMU_transfer(0x00);
                }

                void swr8(uint8_t value)
                {
                                BT8XXEMU_transfer(emulator, value);
                }

                void swr16(uint16_t value)
                {
                                BT8XXEMU_transfer(emulator, value & 0xFF);
                                BT8XXEMU_transfer(emulator, (value >> 8) & 0xFF);
                }

                void swr32(uint32_t value)
                {
                                BT8XXEMU_transfer(emulator, value & 0xFF);
                                BT8XXEMU_transfer(emulator, (value >> 8) & 0xFF);
                                BT8XXEMU_transfer(emulator, (value >> 16) & 0xFF);
                                BT8XXEMU_transfer(emulator, (value >> 24) & 0xFF);
                }

                void swrend()
                {
                                BT8XXEMU_chipSelect(emulator, 0);
                }

                void wr32(size_t address, uint32_t value)
                {
                                swrbegin(address);
                                swr32(value);
                                swrend();
                }

                uint32_t rd32(size_t address)
                {
                                BT8XXEMU_chipSelect(emulator, 1);

                                BT8XXEMU_transfer(emulator, (address >> 16) & 0x3F);
                                BT8XXEMU_transfer(emulator, (address >> 8) & 0xFF);
                                BT8XXEMU_transfer(emulator, address & 0xFF);
                                BT8XXEMU_transfer(emulator, 0x00);

                                uint32_t value;
                                value = BT8XXEMU_transfer(emulator, 0);
                                value |= BT8XXEMU_transfer(emulator, 0) << 8;
                                value |= BT8XXEMU_transfer(emulator, 0) << 16;
                                value |= BT8XXEMU_transfer(emulator, 0) << 24;

                                BT8XXEMU_chipSelect(emulator, 0);
                                return value;
                }                             

Best Regards,
FTDI Community
Logged

uTasker

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Dual FT813 emulation
« Reply #4 on: October 04, 2019, 04:25:06 PM »

Hi

Thanks - I think that basic operation is OK with dual-screens:

https://youtu.be/xsctoGQPgh4

Here I show the uTasker project simulating a Kinetis FRDM-K22F board connected to two emulated BF800s via SPI. All tx data is sent out to both so that both display the same things but the calibration pages show that each instance is really independent.
So I think the product development work can indeed being (using Bridgetek library for first time)!

Regards

Mark



Complete Kinetis solutions for professional needs, training and support: http://www.utasker.com/kinetis.html

uTasker: supporting >1'000 registered Kinetis users get products faster and cheaper to market

Open Source version at https://github.com/uTasker/uTasker-Kinetis


Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Re: Dual FT813 emulation
« Reply #5 on: October 07, 2019, 01:49:27 PM »

Hello,

Thanks for sharing!

Best Regards,
FTDI Community
Logged