PDA

View Full Version : 18F part recomendation



Paul
- 26th September 2005, 04:39
Quite a while ago I used the 18F452 and had all sorts of weird problems, problems that I were unable to explain. My code was stable until I implemented small changes that caused unrelated routines to stop functioning correctly and too give very strange results. It was exceeding frustrating and time wasting, eventually I gave up and went back to the trusted old 16F877 and had no problems. I was using Timer1 as real time interrupt source and that part was written in assembler. I had no problems with it before.

Now the project is evolving and a lot more functionality is required. I am faced with the issue of migrating to the 18F part again, or changing brands of micro.

Has the 18 series been ‘fixed’?

I would like to know your recommended / favourite and reliable 18F part?
I am using timer1 with an interrupt service routine (in assembler)

I require a 40 pin DIP, 16 – 32K of program space, and ADC’s.

Paul.

Melanie
- 26th September 2005, 08:54
Just ensure you have the latest versions of PICBasic and MPLAB.

16F877's progression is really the 18F452, 18F4520 etc. whilst I don't use those parts, I can confirm their smaller brothers the 18F242, 18F2420, 18F252 etc are stable, and I use those where I run out of steam with the 16F876.

sougata
- 26th September 2005, 13:55
Hi there,

I have used the 18F452 for many many applications and it has never let me down. I tend to use it in the HSPLL mode with a 10MHz crystal for full 40MHz speed. Sometimes while using interrupts it is worth noting that this chip has a high priority interrupt vector and pbp uses the low priority. So setting the configuration for interrupts is important. Also if you are using an LCD a few lines of code in the beginning of the program can indicate problems of STACK OVERFLOW (Weird Reboots).

IF STKPTR.7 = 1 THEN ' CHECK FOR STACK POINTER OVERFLOW
LCDOUT "STACK OVERFLOW" ' SHOW IT
STKPTR.7 = 0 ' CLEAR STACK POINTER OVERFLOW BIT
PAUSE 5000 ' LET ME READ THE LCD
ENDIF

IF STKPTR.6 = 1 THEN ' CHECK FOR STACK POINTER UNDERFLOW
LCDOUT "STACK UNDERFLOW" ' SHOW IT
STKPTR.6 = 0 ' CLEAR STACK POINTER UNDERFLOW BIT
PAUSE 5000 ' LET ME READ THE LCD
ENDIF

Regards

Sougata