[SOLVED] Speed upgrade options for existing PIC18F8520 based system

Status
Not open for further replies.

thylacine1975

Full Member level 6
Joined
Dec 7, 2010
Messages
337
Helped
227
Reputation
448
Reaction score
214
Trophy points
1,323
Location
Canberra, Australia
Visit site
Activity points
5,166
'evening all,

I'm assisting in the upgrade of an existing product based around the PIC18F8520 microcontroller (running at its maximum speed of 40 MHz). While updating the hardware, it'd be nice to be able to improve the execution speed of the user interface code..

The catch is that the application code is written in PIC18 assembly and is a beautifully written and debugged 30K monolith, so rewriting it isn't an economical proposition. Without sitting down and studying the opcodes of some of the newer (80 MHz+) PIC18 devices, has anyone any experience in doing something similar? How "portable" between PIC18 family members (assuming the same peripheral devices) does the assembly tend to be?

Does anyone have any specific devices they'd recommend or other (crazy) ideas such as writing a PIC18 emulator on an i7 ?

All suggestions gratefully received!
 
Last edited:

A problem with increasing the clock and processor speed is that the peripheral clock will increase as well
this would lead to you having to change UART baud rate counters, timer counters, etc (plus I2C, SPI, CAN, ????)
also if you are using delays using simple loops, e.g. to slow read/writes to an LCD or similar device, these can cause problem
if you have legacy code best thing is to leave it alone unless you are planning a major revision when one would probably go to a PIC24 or PIC32 with code in C

if the existing user interface is slow could it be speeded up some other way, e.g. if via a UART increase the baud rate?
 

Fortunately much of the the code's timing is well organised and based on the hardware timers/ISRs etc, but aye - you're right: the effects of a higher peripheral clock are going to be widespread (including the aforementioned ISR HW timers...!). Given the years of investment in the legacy code base, it might still be a worthwhile pursuit... but thanks for the warning/reality check though
 

OK - it seems an acceptable path forward has been identified. For the interested reader, here's what I learned:

* The PIC18F8520 was originally used because it was upwardly compatible with code developed on previous PIC16x hardware.
* The PIC18F8720 is the "big brother" to the '8520, although (seemingly - the specs on Microchip's site are a little contradictory) limited to 25MHz operation (instead of 40 MHz).
* The PIC18F8722 is Microchips suggested replacement for the PIC18F8720, adding a few more peripherals and 40 MHz (10 MIPs) speed back again.
* The PIC18F87K22 is the upgrade from the PIC18F8722 (!). Page 543 of the datasheet DS39960D details the differences and alludes to the (potential) code changes required.

So... the condensed version is: the PIC18F8520 *should* be able to be upgraded to a PIC18F87K22, with a core CPU speed increase of 60% (from 10 MIPs to 16 MIPs) ...and hopefully only *minor* code changes required - peripheral clock related headaches as foretold by horace1 notwithstanding

64 MHz (= 16 MIPs due to the CPUclk = Fosc/4) is the highest clock speed available in Microchip's 8-bit family. My reference to 80 MHz in my first post was a misguided consequence of hanging around the PIC32's for too long.

Finally, for the masochistic, I found numerous Google references to open source PIC18 emulators, but it'd take a FAST emulating CPU and a burning desire to really want to bury yourself deep into the architectural subtleties for that to be a viable option. 16 MIPs looks like the practical end of the line
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…