Ones with 34xx should be OK. The 34h = the RETLW instruction. XX is the value returned
in W.
Ones with 34xx should be OK. The 34h = the RETLW instruction. XX is the value returned
in W.
Ok, everthing is working great at 2400 baud. The display and everything is working. Now I need to bump it up to 9600 baud. I read that this requires a faster crystal. Does a standard 2 wire crystal work or are there special ones to use? Is 8mhz all I need? How does one 'hookup' and external crystal. On a propellor chip, its a piece of cake because it has dedicated pins for it, not so on the 12f675. After its attached do I just add a DEFINE OSC 8 to replace the DEFINE OSC 4 command and set the serin to N9600 to replace N2400?
Thanks all.
Jason
Hi Jason,
1. 2 wire crystal works, you do need to use capacitors from the crystal pins to ground.
2. DEFINE OSC xx where xx is the value of the crystal used
3. Yes simply change the number from 2400 to 9600 assuming you have included modedefs.bas
4. Here is the gotcha . . .You must change your config statement from _XT_OSC to _HS_OSC, this allows the PIC to consume enough power to oscillate at the higher FREQ.
I ALWAYS put a config statement into my code at the beginning. The other way is to edit the 12F675.inc file it the root directory of PBP to reflect this change. That is where the DEFAULT config statement resides for THIS chip. You will need to open that file in either case, because even if you choose to write the config statement into your code you will need to comment out ( ;__config . . . ) the existing config statement. Be advised there 2 different config statements in there 1 for MPASM and 1 for the PM assembler,
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
All right Jason,
Grab that data sheet, it's right there under the table leg,open it up to section 9.2.2, you will find a nice little chart, and schematic. That chart will tell you the caps need to be in the range of 15 to 30 pf, and will recommend higher capacities make the oscillator more stable but delay it's start up. . . Please download it (the data sheet) and look this over. That said, most use 22 - 27pf, or resonators as they are easier to mess with. Reading the data sheets are a must, you will understand them more every time you do, and they are free.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Ok, with your help and a little from the data sheet, I ordered some 3 pin resonators at 8mhz and they work fine. Everything works at 9600 baud and all. I hook this project up to my car (ignition on, engine not running) and it works as it should. When I start the car, the display goes crazy with all kinds of numbers. This is what happened when I tried reading an analog voltage using a picaxe. It worked fine on the bench, but didnt work with a running car. I even tried a battery for power and only hooked up the serial line and a ground. Can a schmit trigger be used on a serial line? I can only think that there is too much noise on the line. I can hook that line up to hyperterminal though and it works fine. Any thoughts?
Jason
Thinking out loud . . . serial data is a train of 5v pulses, so I would try putting a small value capacitor across the serial input line and bypass the power bus at the PIC too, it may help to shield the circuit in a grounded metal box too - automotive can make tons of RF especially from the ignition system. Even worse if you have a defective ignition wire as you might have 60000 volts going nowhere. A small value choke in series with the input might help too.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks