CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

CCS Touch Display 4.3" Development Kits
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
colesha



Joined: 09 Jan 2012
Posts: 45

View user's profile Send private message Send e-mail

CCS Touch Display 4.3" Development Kits
PostPosted: Wed Feb 03, 2021 7:44 am     Reply with quote

Hello,
I recently acquired the CCS Touch Display 4.3" Development Kits, but the exercise book seems to be lacking. Has anyone used it before? Am finding it a challenge to send commands to the PIC I/O if say, when a button is pressed at the touch screen, an output pin is updated, also trying to read from analog input and update or display the values at the touch screen.

If anyone can help me with example codes that can be used to read and update I/O pins.
temtronic



Joined: 01 Jul 2010
Posts: 7975
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Feb 03, 2021 8:03 am     Reply with quote

Curious, I went to the webpage. It says they supply a LOT of functions so I assume they may have a few examples, maybe on the CD ? I don't have the 'exercise' book, so I can't comment on what's in there, but CCS has always been great in supplying information.
I can't justify the $200 for the kit though...I enjoy 'minimalist' projects, using 4x20 LCD modules and keypads for a 'GUI'.


jay
colesha



Joined: 09 Jan 2012
Posts: 45

View user's profile Send private message Send e-mail

PostPosted: Wed Feb 03, 2021 8:43 am     Reply with quote

temtronic wrote:
Curious, I went to the webpage. It says they supply a LOT of functions so I assume they may have a few examples, maybe on the CD ? I don't have teh 'exercise' book , so I can't comment on what's in there,but CCS has always been great in supplying information.
I can't justify the $200 for the kit though...I enjoy 'minialist' projects, using 4x20 LCD modules and keypads for a 'GUI'.


jay


The only examples in the exercise book are for graphics and images and maybe a timer only. I engaged customer service but still the example provided was for graphics and timer, requested for an I/O related example but the one who responded said had none, was given some hints but still none helped.
temtronic



Joined: 01 Jul 2010
Posts: 7975
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Feb 03, 2021 8:50 am     Reply with quote

I have to assume the GUI interface is maybe i2C or SPI ?

https://www.nutsvolts.com/magazine/article/graphical-lcd-programming-with-the-touch-display-4.3
if you subscribe you can get the rest of the article, I read about controlling a B0 pin on the GUI module(relay on/off)..
PCM programmer



Joined: 06 Sep 2003
Posts: 21362

View user's profile Send private message

PostPosted: Wed Feb 03, 2021 8:59 am     Reply with quote

Youtube video: CCS Touchscreen Interface Designer Tutorial
https://www.youtube.com/watch?v=mjpHo51jnU4


Files supplied with the CCS compiler in the Drivers folder:
gfx_graphics.c
gfx_graphics.h


I can't find a pdf of the exercise book online.
colesha



Joined: 09 Jan 2012
Posts: 45

View user's profile Send private message Send e-mail

PostPosted: Wed Feb 03, 2021 9:53 am     Reply with quote

temtronic wrote:
I have to assume the GUI interface is maybe i2C or SPI ?

https://www.nutsvolts.com/magazine/article/graphical-lcd-programming-with-the-touch-display-4.3
if you subscribe you can get the rest of the article, I read about controlling a B0 pin on the GUI module(relay on/off)..


Let me subscribe and see if it can be of help
colesha



Joined: 09 Jan 2012
Posts: 45

View user's profile Send private message Send e-mail

PostPosted: Wed Feb 03, 2021 10:08 am     Reply with quote

PCM programmer wrote:
Youtube video: CCS Touchscreen Interface Designer Tutorial
https://www.youtube.com/watch?v=mjpHo51jnU4


Files supplied with the CCS compiler in the Drivers folder:
gfx_graphics.c
gfx_graphics.h


I can't find a pdf of the exercise book online.


Thanks, this type of example is the same as the ones in the exercise book, no control of the I/O pins for the PIC
temtronic



Joined: 01 Jul 2010
Posts: 7975
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Feb 03, 2021 10:34 am     Reply with quote

There might actually be some 'port pin driver code' in one of those gfx_graphics files....
Again, i don't have them so I can't look to see....
Ttelmah



Joined: 11 Mar 2010
Posts: 16935

View user's profile Send private message

PostPosted: Thu Feb 04, 2021 3:11 am     Reply with quote

I think the point is that the 'kit' is aimed at showing how to control the
display, and the touch screen, not how to do basic things with the PIC
itself.
You need to go through the example program, and work out what pins it
actually uses. Then you can simply use the other PIC pins just using the
standard I/O functions.
The setup at the start of the supplied program should say what pins are
used. However I think it'd really be sensible for CCS to actually say this,
so a simple question to them is really called for here. Obviously once this
is known, the standard CCS examples for I/O, and ADC functions then apply.
temtronic



Joined: 01 Jul 2010
Posts: 7975
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Feb 04, 2021 8:14 am     Reply with quote

The ccs webpage for it doesn't say HOW it's connected to a PIC,or how USB can be used ,etc. unless I'm blind...(possible...)so I've asked for 'details'.
I'm assuming USB is just to connect to a PC ?? Which LCDs can connect ?
I can see a few nice applications for it,since you can preload 'screens',so you could use a smaller PIC.
It'd be nice to see the 'specs' though interface, # of screens, etc. I'd hate to toss out $300 only to find it's not what I think it should be .....

edit: CCS got back...

As Mr. T, it's more of a 'how to control' KIT and NOT a 'smart peripheral'. I now have the exercise book and the schematic is in the back. The 8 bit I/O port is on the 1st page of the schematic, with the PIC pins listed.
As purchased, you need to know how to use,program the PIC24EP512GU810 chip. The 'brains on board'.

I was thinking it was a 'smart peripheral', say with an SPI interface, that you could get any PIC to connect to it, access the touch screen,display graphics, use the USB......You could have preloaded 'screens' that the PIC could quickly access and display.

Since it's not a 'smart peripheral', I can't see using it. Life's too short to try to learn PIC24 !!

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 16935

View user's profile Send private message

PostPosted: Fri Feb 05, 2021 12:42 am     Reply with quote

Except, that there is really pretty much nothing to learn!...

The key thing with CCS is that you can write code that 99% doesn't
care what chip it is on.
Things where this doesn't apply:
1) PIC24/30/33, default integers are signed, and 16bit. This is the most
major change.
2) Clock setups and fuses for the chip. However using the internal clock,
this can be pretty much done for you by just specifying INTERNAL=xxxMHz.
2) Peripheral setups. Exactly the same as for later PIC18's. 'pin select', and
just use the peripheral name.

However, except fo the massive difference in speed and pin impedances
on the ADC, all the basic simple I/O operations and ADC operations behave
exactly like the PIC18.

I had working code on my first DsPIC, within 30 minutes of starting.
temtronic



Joined: 01 Jul 2010
Posts: 7975
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Feb 05, 2021 5:39 am     Reply with quote

The 'problem' for me is that as a' PIC on a PCB', you've only got access to 8 DIO and 6 AIO in addition to the USB CDC port and the GCLD subsystems.
I think they could sell a boatload of them if it was a 'smart peripheral' though.
colesha



Joined: 09 Jan 2012
Posts: 45

View user's profile Send private message Send e-mail

PostPosted: Fri Feb 05, 2021 5:56 am     Reply with quote

Thanks, Telmah/Temtronic,

the kit is just like any development board from CCS, the one I have has 8 DI/DO pins and 6 AIN/AO pins. So I can use them for some other functions, the DIN is connected through an ST2378E so that they can be 5V dependent.

When I set the standard io pins for the DI/O, irrespective of the code, these Pins are always high hence the code had no effect on them, however, if I choose one of the Analog pins as a digital pin, the code works perfectly well.
So am still figuring out why the other dedicated pins don't work as expected. But if I write a standard code to use only the pic and ignore the graphics, like to flash a led they work fine

I managed to write a code that can drive a pin when a button is touched on the screen

below is a sample i did:

Code:

#use STANDARD_IO(B, F)

#define hdrB0 PIN_B0
#define hdrF2 PIN_F2
#define hdrF1 PIN_F1


Then I added this line in the touch task handler routine for the screen touches

Code:


switch(g_CurrentWindow)
      {
         case WINDOW_MAIN:
            if(ImageId == IMG_ID_MAIN_DOWNARROW)
            {
               if(AreaId == DOWNARROW_AREA_BTN)
               {
                  HandleBtnPress(HandleId, AreaId);
                  output_low(hdrB0);  // added this line
               }
            }
            else if(ImageId == IMG_ID_MAIN_UPARROW)
            {
               if(AreaId == UPARROW_AREA_BTN)
               {
                  HandleBtnPress(HandleId, AreaId);
                  output_high(hdrB0); //added this line
                 
               }
            }
            break;
      }



This works for the analog pins, but does not work for the digital pins.
colesha



Joined: 09 Jan 2012
Posts: 45

View user's profile Send private message Send e-mail

PostPosted: Fri Feb 05, 2021 5:58 am     Reply with quote

temtronic wrote:
The 'problem' for me is that as a' PIC on a PCB', you've only got access to 8 DIO and 6 AIO in addition to the USB CDC port and the GCLD subsystems.
I think they could sell a boatload of them if it was a 'smart peripheral' though.


Very true, I agree with you, this board is quite expensive tho
Ttelmah



Joined: 11 Mar 2010
Posts: 16935

View user's profile Send private message

PostPosted: Fri Feb 05, 2021 6:11 am     Reply with quote

Jay says that the stuff for the board does include the circuit diagram. So
the actual connections should be easy to work out.
The ST2378E, does imply (assuming it's high side supply is connected to
5v), that the inputs/outputs can use 5V levels.
Look at the circuit. Does the ST2378E have 5v power?. I'd be suspicious
that you possibly have to actually supply it from the I/O header, which is why
it doesn't work...
Or there may be a jumper for it's power, which again has to be made.


Last edited by Ttelmah on Fri Feb 05, 2021 6:28 am; edited 1 time in total
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group