[SOLVED] General help/guidance with LPC54605 / emPower_USB_Host

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] General help/guidance with LPC54605 / emPower_USB_Host

    Hi,

    I recently purchased an emPower USB-Host board (6.90.00) to test, hoping that adding an LPC546 with emUSB_Host software would be a quick and easy way to add a USB HID host (and thus a USB keyboard) to my home-made computer to replace the existing PS2 one there.

    I have the USB HID demo working on the USB-Host board and can read keypresses/releases via the J-Link debugger and I am now trying to get my head into the complexities of the C++ dev environment so I can tweak the USB_HID demo project. I want to be able to modify the project so that instead of (or as well as) sending the keypresses to the J-Link via the SWD interface, I can get the LPC54605 to send the keycodes out via a serial interface to an FPGA in a custom board I'm creating. I realise there are better methods of connecting the LPC to an FPGA, but I'm happy with a two-wire serial (with CTS/RTS if necessary) for the moment if I am going to stick to just a USB keyboard peripheral.

    I seem to need a bit of help and/or a pointer in the right direction though, as I can't work out how to set up a simple serial interface in the LPC546. I'm brand-new to the LPC546xx and very inexperienced with C++ (I'm probably a basic C# programmer, with lots more experience in Javascript, PHP, HDL/Verilog and Z80 assembly than anything else).

    Can anyone point me to a (simple) example of a serial interface for the LPC546xx, so I can decipher how to set up my chosen pins (probably Flexcomm 3 USART Tx/Rx on PIO0_2 and PIO0_3) and send data via the serial interface instead of to the SWD interface? I guess some simple tutorials on what I'd need to know re: C++ project management would be important too, as telling me to 'add this file to the project' may be met with a confused question... ;(

    Any help would be gratefully received - any code or step-by-steps would be massively appreciated. :)

    Thanks in advance!
  • Hello,

    Thank you for your inquiry.
    The simplest solution to get the emPower_USB_Host Board connected to your FPGA would be using a cheap USB-2-UART adapter.

    Then the setup would look something like this:
    [HID Device]--[Port1]---[emUSB-Host]----[Port2]----[USB-2-UART,like FT232 or CP210x]--[RS232]-----FPGA

    Samples for this usecase can be found in our ESPRO package for the emPower USB Host Board.
    segger.com/products/developmen…io/editions/pro-cortex-m/
    Simply install the ESPRO Package via the Embedded Studio package manager and create a project for your board.

    The sample applications are called USBH_HID_Start.c, USBH_FT232_Start.c and USBH_CP210X_Start.c.


    Documentation about Embedded Studio can be found here:
    studio.segger.com/
    wiki.segger.com/Embedded_Studio

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks for your reply, Nino.

    Sorry if I wasn't clear enough in my original question - I'm not looking to connect the emPower_USB_Host Board to my FPGA. I just got the emPower_USB_Host Board to test out the demo software and prove the concept.

    I'm actually looking to build a custom PCB with an FPGA and an LPC546 on it, using the emPower_USB_Host Board schematic as a template for the LPC546 and supporting components on my custom PCB. I intend to install the embOS/emUSB-Host firmware onto the LPC546, then load in my custom USB-HID software to output the keyboard keycodes to the FPGA via the serial interface I outlined in my question.

    I just need to know how to set up a simple serial interface on an LPC546. I'll take a look at those examples you've linked and see if there's anything of help in them.

    Thanks!
  • Hi,

    Thank you for clarifying.
    Raw UART samples are usually provided by the silicon vendor in plenty of sample code in some SDKs or Libraries.
    That is why we do not provide any generic UART code as there is no point in reinventing the wheel.

    Generally your scenario would work. Regarding the bare metal UART implementation we recommend to check NXPs support and resources as that is outside of our support scope as it has nothing to do with our products.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.