• AVR Freaks

Graphic pictail board Plus pic 32 starter kit

Author
mini
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2009/01/21 00:49:28
  • Location: 0
  • Status: offline
2009/06/01 01:58:59 (permalink)
0

Graphic pictail board Plus pic 32 starter kit

hello all,

I am new to starter development kits. Presently I have pic 32 starter kit and Pic 32 I/O expansion board and I am interested to interface this with graphics pictail board(version 2). First of all, I wanted to get familiar with the development kit so I tried with glowing some led's( through example program given by microchip).

Now I want to try graphics library demo programs..

I have gone through the help file which is provided by microchip. The important thing I found out in that file is to calibrate touch screen before we start the program. But that help file is for explorer 16 board i.e In that file I find out that


"When downloading the Graphics Object Layer demo for the first time, screen calibration is run automatically. It can also be invoked by performing the following steps:
Press the S3 and Reset (MCLR) button of the board simultaneously. Releasing the Reset switch while holding S3 down. After releasing the Reset switch, the calibration instruction screen will be shown. S3 switch can be released at this point. Follow the instructions to calibrate the touch screen module. If calibration is not performed properly Graphics Object Layer demo WILL NOT WORK."


Can some body help me how to calibrate touch screen on pic 32 I/O expansion board and what are the necessary changes in the source code that I should make to get this demo started.

regards
mini
#1

9 Replies Related Threads

    BruceTElliott
    Super Member
    • Total Posts : 836
    • Reward points : 0
    • Joined: 2006/08/08 08:14:43
    • Location: Germany
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/01 06:46:46 (permalink)
    0
    The support for the starter kit with graphics is somewhat thin. First of all, the I/O board doesn't have an SPI EEPROM like the EXP16, but an I2C EEPROM. So you can't read or store the calibration without redoing the software - or better: cutting it out and calibrating always. You have to change TouchSceen.c

    The buttons have to be remapped to RD6, RD7, RD13, which can still cause problems in some of the demos which use S4 on the EXP16.

    The easiest thing to do is to start out with the really simple ANxxxx demos, since they don't really use much of the hardware. For the other demos, you'll eventually have to rework the HardwareProfile.h to accomodate the starter kit.

    <edit: cange change, buttons>
    post edited by BruceTElliott - 2009/06/02 21:29:05
    #2
    mini
    Starting Member
    • Total Posts : 68
    • Reward points : 0
    • Joined: 2009/01/21 00:49:28
    • Location: 0
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/01 21:06:05 (permalink)
    0
    The buttons have to be remapped to RD0-RD3


    Thankyou  for reply Bruce. As you said the buttons should be remapped does it mean to change the firmware only or should I make any hardware changes. Is there any other way to use the graphics library entirely. I can't afford to buy explorer 16 board now.
    #3
    mini
    Starting Member
    • Total Posts : 68
    • Reward points : 0
    • Joined: 2009/01/21 00:49:28
    • Location: 0
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/02 02:42:23 (permalink)
    0
    Now, I worked with AN1136 and AN1182 entire thing was working fine but when I built AN1246 the screen showed instructions for touch screen calibration and I did as it is. After that my lcd screen is displaying only black screen and then even if I run previous demo's it is not at all working. Please someone steer me in the right direction.
    #4
    BruceTElliott
    Super Member
    • Total Posts : 836
    • Reward points : 0
    • Joined: 2006/08/08 08:14:43
    • Location: Germany
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/02 20:46:14 (permalink)
    0
    did you comment out the TouchLoadCalibration() in main (after the calibration section)? You should not be calling TouchStoreCalibration() or TouchLoadCalibration() at all, or false values will be loaded. In the calibration routine, the values entered will be stored in variables. If there is still code trying to load or store the values, it won't work.

    My changed part of my main looks like this (no remapping of buttons, defined _PIC32_STARTER_ in HardwareProfile.h)


    #if (GRAPHICS_PICTAIL_VERSION != 3)
    #ifndef _PIC32_STARTER_
       EEPROMInit();                       // initialize Exp.16 EEPROM SPI
    #endif
       BeepInit();
    #else
       SST25Init();                           // initialize GFX3 SST25 flash SPI
    #endif
       TouchInit();                        // initialize touch screen
       GOLInit();                          // initialize graphics library &
                                           // create default style scheme for GOL
       TickInit();                         // initialize tick counter (for random number generation)

        // Clear screen
       SetColor(WHITE);
       ClearDevice();

    #ifndef _PIC32_STARTER_
      // If S3 button on Explorer 16 board is pressed calibrate touch screen
       if(PORTDbits.RD6 == 0){
           TouchCalibration();
           TouchStoreCalibration();
       } else {
     
           // If it's a new board (EEPROM_VERSION byte is not programed) calibrate touch screen
           #if (GRAPHICS_PICTAIL_VERSION < 3)
               if(GRAPHICS_LIBRARY_VERSION != EEPROMReadWord(ADDRESS_VERSION)){
                   TouchCalibration();
                   TouchStoreCalibration();
               }
           #else
               if(GRAPHICS_LIBRARY_VERSION != SST25ReadWord(ADDRESS_VERSION)){
                   TouchCalibration();
                   TouchStoreCalibration();
               }
           #endif   
     
           // Load touch screen calibration parameters from EEPROM
           TouchLoadCalibration();
       }
    #else
       TouchCalibration();
    #endif


    <edit: code example> 
    post edited by BruceTElliott - 2009/06/02 21:38:43
    #5
    mini
    Starting Member
    • Total Posts : 68
    • Reward points : 0
    • Joined: 2009/01/21 00:49:28
    • Location: 0
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/03 02:10:44 (permalink)
    0
    Smile Finally, I am able to run the demo as well as my own code using pic 32 starter kit for graphics. I have completed displaying all the widgets on the screen.

    Can some body guide me to write simple code for interactive buttons on touch screen.

    Bruce as you said I have noticed that calibration values are stored in variables. So, I got an idea, can I store this values in some global variables before it stores into eeprom and later I will load this values back into actual variables.

    One more question, if I want want to display pictures(.bmp,.jpg) is it neccessary to have an eeprom. If so, should I use external eeprom which works with spi protocol.


    #6
    BruceTElliott
    Super Member
    • Total Posts : 836
    • Reward points : 0
    • Joined: 2006/08/08 08:14:43
    • Location: Germany
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/03 07:29:37 (permalink)
    0
    The values are stored in global values already. AN1136a on the MCHP graphics page explains in detail how make your own widgets. The other tutorials are also very good. Don't expect to be able to write a prize-winning application at the beginning - there's a bit of learning involved before the display does what you want to do.
    The "Image Decoders Demo" in the graphics library 1.6 download shows how to display images. You can either convert the image to data stored in the program area of the PIC32 (limited, of course) or store it externally in the spi flash on the graphics board. This is explained in the demo - you have to search a little.
    You could also use the flash to store the calibration. You need to check the code for the SST25VF016B pins. Look at the code for loading images to see how to use the flash chip.


    #7
    mini
    Starting Member
    • Total Posts : 68
    • Reward points : 0
    • Joined: 2009/01/21 00:49:28
    • Location: 0
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/03 20:48:13 (permalink)
    0
    Don't expect to be able to write a prize-winning application at the beginning - there's a bit of learning involved before the display does what you want to do.


    I agree with you Bruce. Yesterday, I have tried small programs like interactive buttons, moving a slider and opening and closing a window when buttons are pressed. I am expecting  cheerful  help from you for rest of my graphics library project... Thankyou
    #8
    mini
    Starting Member
    • Total Posts : 68
    • Reward points : 0
    • Joined: 2009/01/21 00:49:28
    • Location: 0
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/05 21:06:24 (permalink)
    0
    Bruce, Now I am trying to display digital clock.. In GOL.h I have seen enum type timer
    typedef enum {                 
        TYPE_UNKNOWN = 0,            // Unknown device.
        TYPE_KEYBOARD,                 // Keyboard.
        TYPE_TOUCHSCREEN,              // Touchscreen.
        TYPE_MOUSE,                    // Mouse.
        TYPE_TIMER,                       // Timer.                  //**********how to use this timer .....**************//
        TYPE_SYSTEM                       // System Messages.
    } INPUT_DEVICE_TYPE;

    Presently I have written a code which is not a standard one, but how ever it is working
    int main()
    {
    .......
    .....
        StCreate(    ID_STX,
                     80,120,240,150,
                    ST_CENTER_ALIGN|ST_DRAW|ST_FRAME,
                    Str,
                    altScheme);
           
        update = 1;                            // to initialize the user graphics

        while(1)
            {
                if (TMR1_IF)                                       //*******here I am checking for timer interrupt flag*****//
                {
                TMR1_IF=0;
                GOLFree();
                CompareTime(pStr);
                     StCreate(ID_STX,
                     80,120,240,150,
                    ST_CENTER_ALIGN|ST_DRAW|ST_FRAME,
                    Str,
                    altScheme);
                }
                GOLDraw();
            }
            }

    Please guide me in correct way..

    Also I have noticed that program is using pll_mul as 18 and Pll_div as 2 can I change this values.




    #9
    mini
    Starting Member
    • Total Posts : 68
    • Reward points : 0
    • Joined: 2009/01/21 00:49:28
    • Location: 0
    • Status: offline
    RE: Graphic pictail board Plus pic 32 starter kit 2009/06/10 22:39:58 (permalink)
    0
    Please some one help how to clear the states of the widgets on the screen in lcd. For example, I am placing two buttons on the screen left and right. when I press this buttons it should go to next screen if there is one. presently I am doing this by hiding the widget state, I think this will increase the active linked list ojects. If I clear the objects, by using ClrState() the objects are still on the screen. How to solve this issue.
    #10
    Jump to:
    © 2019 APG vNext Commercial Version 4.5