This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Application interfacing with DM355

Other Parts Discussed in Thread: TMS320DM355

Hi,

I am developing an application for one of our product that uses TMS320DM355.

There are buttons(switches) are connected to the General input/output pins of the DM355. button 0 to button 3 are connected to pins GIO027-GIO030. And button 4 and button 5 to GIO102 and GIO103 respectively.

I want to increase and decrease the brightness of the display screen by pressing these buttons.

I am programming in C for this application. But I need help to get started with this application.

If you need more details about this product and the application please ask me.

Thanks

  • saadia said:

    I am developing an application for one of our product that uses TMS320DM355.

    There are buttons(switches) are connected to the General input/output pins of the DM355. button 0 to button 3 are connected to pins GIO027-GIO030. And button 4 and button 5 to GIO102 and GIO103 respectively.


    Based on this information, I assume you are referencing your own target hardware using the TMS320DM355, correct?

    saadia said:

    I want to increase and decrease the brightness of the display screen by pressing these buttons.

    I am programming in C for this application. But I need help to get started with this application.

    If you need more details about this product and the application please ask me.


    Yes, I think I will need additional details.

    What operating system are you using?
    You will need to indicate what hardware facilities you have available to adjust the display screen brightness.

     

  • The display screen has a driver IC which has some registers that control the brightness of the screen.

    There is also PIC16F886 in the PCB. The operating system which is used in the eval board of the TMS320DM355 is same as this(montavista).

     

     

  • This actually sounds like something you would do with a Linux driver as opposed to a user application, though it would be possible to do as a user application if you already had drivers in place for the GIO and your display driver IC. This is still a bit of a broad question, how you actually want to implement this is up to you.

    This could be broken up into three pieces, a GIO driver (probably interrupt driven), a display driver IC driver (probably over I2C), and some interface software between the two. You likely already have some existing driver code out there you could use as an example for the GIO and display driver IC driver, so for starters you may want to get those portions working individually. Once you have both hardware ends functioning properly putting together the interface software should be fairly simple, and could be done as a user application as all it would need to do is access the driver APIs and make adjustments to the display driver IC based on the GIO events. As this will likely require some significant driver work you may want to take a look at Linux Device Drivers, Third Edition, it makes a great reference for how Linux device drivers work and should be helpful to you while making adjustments to the drivers.

  • Normally, only drivers can access hardware registers, hence you will need a GPIO driver along with the driver IC for the display screen.  For common peripherals (e.g. GPIO, I2C, video capture, video display), there are standardized Linux driver APIs; you can find documentation on most standardized Linux APIs under the Linux Kernel source tree (e.g. lsp/ti-davinci/documentation ).

    That said, the first thing I would do is find out the 'driver IC' API (Application Programming Interface) and write an application to control the brightness independent of GPIO. 

    I believe there is a GPIO driver included with DM355 DVSDK already (not 100% sure); if not, you will need to write one.  Once you have the GPIO driver, then you can add to you user application to monitor GPIO events and control brightness accordingly.

  • I know what register in the driver IC changes the brightness settings, and I can write C code for it to handle. The display is connected to the GPIO pins in the DM355.  Writing and reading GPIO pins is what im confused about. I saw the c files u asked me to above, but I dont really understand alot in it.

    Just help me pls.

  • Saadia,

    I am afraid the gpio driver provided is only accessible by other kernel drivers.  Most likely, you need a gpio driver accessible by user space and which supports GPIO interrupts (so when button is pressed, you get an interrupt and adjust brightness).  The GPIO driver provided can serve as reference code, but you may have to write your own.

     Caution:  If you rewrite your own, be careful not to conflict with other device that may be using current GPIO driver.

  • ok So i got to write my own codes to control the GPIO driver. As im very new to all this..I would require some explanation and sample codes...anyoe willing to help?

  • While we would be glad to help as you have questions along the way but unfortunately there are not any example codes available. While what you are doing is not necessarily simple there is a lot of information out there on working with Linux device drivers, in particular the LDD3 book mentioned previously would be a good place to start to understand what has to be done. Working with a GPIO driver is one of the simplest possible ways to get started in Linux driver development, in fact you may want to consider the Monta Vista EMB530 class which contains labs that go through working with a GPIO driver.

  • As Bernie metiones, GPIO drivers are one of the simplest Linux drivers you can write; as a matter of fact, the code below is a simple (and complete) Linux driver that shows how to toggle GPIO pin.  As you can see, the source code is rather simple....

    #include <linux/init.h>
    #include <linux/module.h>
    #include <linux/kernel.h>
    #include <linux/ioport.h>
    #include <asm/io.h>

    #define PINMUX0 __REG(0x01c40000)
    #define DIR0 __REG(0x01c67010)
    #define BINTEN __REG(0x01c67008)

    static int __init mymod_init(void)
    {
      printk(KERN_INFO "PINMUX0 : 0x%08lX\n",PINMUX0);
      PINMUX0 |= 0x00800000;
      printk(KERN_INFO "PINMUX0 : 0x%08lX\n",PINMUX0);

      printk(KERN_INFO "DIR0    : 0x%08lX\n",DIR0);
      DIR0 |= 0x0000000f;
      printk(KERN_INFO "DIR0    : 0x%08lX\n",DIR0);
      printk(KERN_INFO "BINTEN  : 0x%08lX\n",BINTEN);

      return 0;
    }

    static void __exit mymod_exit(void)
    {
      printk(KERN_INFO "Module exit\n");
    }

    /* init and exit functions */

    module_init(mymod_init);
    module_exit(mymod_exit);

    MODULE_LICENSE("GPL");

     

    As I mention in my previous post, you should exercise caution and not conflict/overwrite with other GPIO settings in the system.