PDA

View Full Version : 16F819 Help



jpeakall
- 2nd December 2003, 18:19
Hi all,

I am trying to use a 16F819 and getting nowhere. Anyone have any kind of code for this beast? I think my problem is the initialization of the internal osc, which I would like to use at 8 mgHz. ANy and all code snips most welcome!

Jonathan

jbirnsch
- 3rd December 2003, 00:42
Add these lines to the top of your program:

@ DEVICE PIC16F819, INTRC_OSC_NOCLKOUT, WDT_OFF, LVP_OFF, PWRT_ON, PROTECT_OFF

DEFINE OSC 8
OSCCON = $70





I too had issues with this cool PIC but I found this info on the old email PIC list that got me going.

Jason

jpeakall
- 3rd December 2003, 04:02
Jason,

Thanks! Got the chip working.

Jonathan

bearpawz
- 29th December 2006, 04:23
Ive tried pasting that into my code:

@ DEVICE PIC16F819, INTRC_OSC_NOCLKOUT, WDT_OFF, LVP_OFF, PWRT_ON, PROTECT_OFF

DEFINE OSC 8
OSCCON = $70


And I get an Illeagle Opcode error from MPASM:

paul borgmeier
- 29th December 2006, 06:44
Take a look in the 16F819.INC file in your PBP folder. The “Device” statement is for PM – you need to use the format for MPASM if you are using MPASM. You can either comment out the version in .inc file and include your own there or comment it out in the .inc file and include them in your file. See this link for lots more on this ...

http://www.picbasic.co.uk/forum/showthread.php?t=543

EDIT:
Hey, I just noticed that you have contributed to this link as post #2 - it has grown!

muddy0409
- 29th December 2006, 13:19
Hello all,
Sorry to eavesdrop on this thread, but as I am also using an 'F819 in a project, I thought I might learn something.
Having NEVER tried to operate any chip with internal osc. this seemed to answer my unasked question...
So I put that bit of code in, but with defineosc 4 for 4MHz. (the ones I've got)
Pulled the crystal out of my development board and tried it. LCDOUT works beautifully.
All seemed ok until I got to the part where I was debugin-ing some stuff and the section did not work at all. Re-prog'd with XT osc. and all went well again with the crystal in.
There is obviously some other stuff to be added?????

BTW, am debugin-ing at 9600.



Regards,
Peter Moritz,
Up the bush, By the Sea, South Australia.