PDA

View Full Version : 16f818 Fuses



andybarrett1
- 6th March 2015, 12:31
Hi all.

1) Using the internal oscillator to do some basic stuff which is working great (Surprise to me )
But now I want to use the I/O ports tied up with the oscillator output.... I am using "INTRC_CLKOUT" at moment.
"INTRC_NOCLKOUT" just results in errors ??


2) I have some code (timing non critical) working fine elsewhere with a little 12Megs crystal and 2 22pf caps.... I want to remove the crystal to cut costs. But when I take the crystal out and use the internal RC circuit I get corruption on my 4bit lcd, display also misses characters ... This is repeatable ... I didn't think the LCD timing was so reliant on the clock ?

Thank you for reading

BR
Andy

HenrikOlsson
- 6th March 2015, 12:59
Hi,

1) Where did you find it should be INTRC_NOCLKOUT? For the 16F818, try INTRC_IO instead.

2) The HD44780 (and compatible controllers) needs a certain delay for commands and data (which is what the DEFINE LCD_DATAUS 50 etc is for). If the program is written for a 12MHz clock but you change to, say 32MHz internal oscillator without telling the compiler that you did, then the 50us datadelay (default) becomes 12us. If you changed to LOWER oscillator frequency I wouldn't expect it to corrupt the display. Can you elaborate a little bit on what you actually did?

/Henrik.

andybarrett1
- 6th March 2015, 13:20
Hi Henrick

1) Where did you find it should be INTRC_NOCLKOUT? For the 16F818, try INTRC_IO instead.
Mixed up with 16f628 .... My Bad Thank you

2) The HD44780 (and compatible controllers) needs a certain delay for commands and data (which is what the DEFINE LCD_DATAUS 50 etc is for). If the program is written for a 12MHz clock but you change to, say 32MHz internal oscillator without telling the compiler that you did, then the 50us datadelay (default) becomes 12us. If you changed to LOWER oscillator frequency I wouldn't expect it to corrupt the display. Can you elaborate a little bit on what you actually did?

I dropped from 12Megs external to 8Megs Internal... Used Oscon = $70 from memory! Fastest the 818 goes is 8megs ?

Thank for help
Andy

HenrikOlsson
- 6th March 2015, 13:51
Hi Andy,
OSCON = $70 doesn't look right but doesn't really matter. You're correct, 8MHz is as fast as it can go so I'm a bit surprised your getting garbage on the display by running it slower than defined. But, just to make sure, why not change the DEFINE OSC 12 in your code to reflect the correct oscillator frequency? I'd certainly try that but as I said, I would not expect the results you're getting from lowering the oscillator frequency...

/Henrik.

andybarrett1
- 6th March 2015, 14:19
OSCCON = $70 ... I dropped the middle C

Will play later... see where I get.

TY Again

HenrikOlsson
- 6th March 2015, 15:25
I meant the value $70, didn't even notice the missing C in OSCCON but never mind.

/Henrik.

andybarrett1
- 6th March 2015, 21:55
We had a play….IO is now working but …The display still corrupts when no xtal.

Tried different display…..different processor but still missing bits !!!!

andybarrett1
- 8th March 2015, 20:42
Strange things….

To follow up….
12Megs Xtal LCD is fine.
8Megs Internal Clock… Garbaged LCD.
Lowered to 4Megs Internal Clock LCD all fine

Had a look at control lines for LCD with scope….. All fine and square with Xtal, Not so with 8Megs Internal Clock

Lowered to 4Megs Internal clock, Control lines OK again.

Running of a battery so not line pickup….Lots of 0.1uf caps close to key IC's.

Interesting though…. ??