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 CCS Technical Support

fastest PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
georpo



Joined: 18 Nov 2008
Posts: 281
Location: Athens, Greece.

View user's profile Send private message

fastest PIC
PostPosted: Sun Nov 06, 2011 8:41 am     Reply with quote

Hello,

I am currently using a PIC24HJ256GP206 overclocked at 100MHz giving 50MIPS
but I need something much faster in order to display video on a TFT display.

So, which is the fastest PIC supported by CCS?

Thanks!
_________________
George.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

Re: fastest PIC
PostPosted: Sun Nov 06, 2011 9:22 am     Reply with quote

georpo wrote:
Hello,

I am currently using a PIC24HJ256GP206 overclocked at 100MHz giving 50MIPS
but I need something much faster in order to display video on a TFT display.


Use the PIC24FJ256DA210

Has a built in hardware video controller that does the work for you in hardware...

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
georpo



Joined: 18 Nov 2008
Posts: 281
Location: Athens, Greece.

View user's profile Send private message

PostPosted: Fri Nov 11, 2011 10:34 am     Reply with quote

The PIC24FJ256DA210 is much slower than the one I use.

It is not a matter of graphics etc. The video is stored as bitmaps in a SD card. I just need faster data transfer when writing on the 16bit bus.
Right now my TCY is 50MHz giving 20nS instruction cycle.
I need something 5 times faster than this.

So, again to the starting question.

Which is the fastest PIC supported by CCS?

Thanks.
_________________
George.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Nov 11, 2011 12:19 pm     Reply with quote

georpo wrote:
The PIC24FJ256DA210 is much slower than the one I use.

It is not a matter of graphics etc. The video is stored as bitmaps in a SD card. I just need faster data transfer when writing on the 16bit bus.


let's review.

In your previous post, you said you're transfering graphics to a TFT display over the 16bit bus of a PIC. And you need speed.

I'm guessing (not assuming) you're driving the TFT display directly without a controller...

In which case, I suggest a PIC with a built in LCD display controller.

Then you tell me, "It's not a matter of graphics."

Um. Ok.

Well, unless you're using 4bit SDcard transfers, you're going to be spending your largest bottleneck there.

After that, if you are really driving the display directly, you're wasting a lot of CPU power on driving the LCD.

Quote:

Right now my TCY is 50MHz giving 20nS instruction cycle.
I need something 5 times faster than this.

So, again to the starting question.

Which is the fastest PIC supported by CCS?


I'm guessing you've actually picked the wrong microcontroller for the job.

Good luck,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 11, 2011 12:30 pm     Reply with quote

You can use this Microchip tool to find fast PICs:
http://www.microchip.com/maps/microcontroller.aspx

Choose the basic type of PIC in the box on the upper left. Also, click on
the little + in the corner, so you can see tickboxes for "Current, Future, etc.

Then go down to the row for "Max CPU Speed", and select the MIPS that
you want. For example, to get a mininum of 60 MIPS select that for the
first column but leave the 2nd column as -All-.

The page will automatically update in a couple seconds, after you make
any change. The list of suitable PICs will appear in the Search Results box.
georpo



Joined: 18 Nov 2008
Posts: 281
Location: Athens, Greece.

View user's profile Send private message

PostPosted: Fri Nov 11, 2011 1:59 pm     Reply with quote

The TFT panel has built in SSD1963 controller.
It is not driven directly from the PIC.

Imagine that I had a really fast card that can give me the desired speed
or that I had all the bitmaps in RAM. Not possible. I know. Just imagine.

So, what I would need is to feed the 16bit bus so fast:

480x272 pixels = 13560 pixels x 3 bytes/pixel (for 24 bit color)
=391680 bytes per frame.

391680 bytes /2 (because it is a 16bit bus) = 195840 words x 25 frames/sec
=4896000 words/second.

This is not so fast but think that before each word write, the PIC
has to calculate and shift the RGB bytes in the word to be written.

With the current PIC running at 50MHz, this is what I get:

ftp://user:[email protected]/2GBSD/graph.jpg

This is taken from the /WR pin. It takes 664nS for 3 words transfer.

I am thinking of going NXP ARM.
_________________
George.
n-squared



Joined: 03 Oct 2006
Posts: 99

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sat Nov 12, 2011 3:24 pm     Reply with quote

Hi
Microchip has released a new family of PI24 chips that run at 60MIPS.

The PIC24EP256GU810-I/PF is a 100TQFP device with 24K bytes of RAM.

BR
NN
_________________
Every solution has a problem.
drolleman



Joined: 03 Feb 2011
Posts: 116

View user's profile Send private message

PostPosted: Sun Nov 13, 2011 12:53 pm     Reply with quote

Looking at the scope output there appears to be a lot of load / capacitance that is causing the signal to look like it does. You need to make the traces as short as possible, but thick enough to carry the current.

The other thing to do is pre-create your image in ram. Also this may look good in code 'Write_Data((color)>>16)' but expensive in clock cycles at runtime. Have this broken up before you write to the screen.
Code:

char colorR[20] = {20,5,2...
char colorG[20] = {24,56,12...
char colorB[20] = {20,51,27...

output_low(CS);//CS = 0;
output_d(colorR[clr]P1 = command;
output_high(CS);//CS = 1;
delay_cycles(2);

output_low(CS);//CS = 0;
output_d(colorG[clr]P1 = command;
output_high(CS);//CS = 1;
delay_cycles(2)

output_low(CS);//CS = 0;
output_d(colorB[clr]P1 = command;
output_high(CS);//CS = 1;

This writes to the controller as fast as it can and a 24FJ can write where you see no flickering on the screen even 640x480.

Creating a loop so that the code looks cleaner will also slow it down. So if the purpose is to speed it up, then think of what the controller has to do to run this. Look at the .lst file as to what the controller has to do.
georpo



Joined: 18 Nov 2008
Posts: 281
Location: Athens, Greece.

View user's profile Send private message

PostPosted: Mon Nov 14, 2011 12:24 pm     Reply with quote

This is what I use to fill all 480*272 pixels with a color.
Color is a 32 bit value, I use the 24 lower bits to represent 8 bits for RED, 8 bits for GREEN and 8 bits for BLUE.
Data is packed in 16 bit format and requires 3 writes in order to fill 2 pixels:

RG 1st word contains RED and GREEN of 1st pixel
BR 2nd word contains BLUE of 1st pixel and RED of 2nd pixel
GB 3rd word contains GREEN and BLUE of 2nd pixel

Code:

void fill_screen(int32 color){

   WindowSet(0,479,0,271); // tell the controller the area we are going to write to.
   WriteCommand(0x2c);    //command to start receiving data

   RS=1;                   //select DATA register

   for(x=0;x<65280;x++){ //480*272=130560 / 2 =65280
    BUS=COLOR>>8;
    WR=0;
    WR=1;

    BUS=COLOR<<8 |( COLOR>>16 & 0xFF);
    WR=0;   
    WR=1;

    BUS=COLOR& 0xFFFF;
    WR=0;
    WR=1;   
   }
}



If I just toggle the /WR pin like this:
Code:


While(1){
 output_high(WR);
 output_low(WR);
}


Then I have 25MHz at the oscilloscope. More than enough!
But as you see above, all this calculation before the actual write,
give me a very slow transfer rate.

As about the pre-create image in RAM isue, it is a good idea
but as you can see a full image is 391680 BYTES= 195840 WORDS. No ram can hold this!

Am I missing something??

Thanks!
_________________
George.
drolleman



Joined: 03 Feb 2011
Posts: 116

View user's profile Send private message

PostPosted: Mon Nov 14, 2011 3:05 pm     Reply with quote

When i indicated in ram, you use intelligent writing, where writing is required only. If a object needs updating then update that object. You don't create a raw image in ram but its color / format / location / what it is. This uses very little ram. For fill areas use the fast fill method.

eg. button
put outline of button
fill inside
write char's

It's the fill that usually takes the most time to write, since cpu cycles / pixel comes into play. The more complex, the more cpu cycles required to get the job done. I like to use a scope to tell me how long it takes to do something. or use the stopwatch in the realice to help trim how long it takes to do something.

If I'm writing a 7 seg item than I pre-format in ram. Usually it is fgcolor / bkcolor this only uses 1 bit per pixel even if you use 64k color! very little ram used. So when sending it to the controller it's very fast.

This method doesn't work on images, then you would need enough ram to support full image in ram. Or the video controller would need paging capabilities.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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