Ah... well thats another desperate idea gone...
I'll try the timing trials.
Ah... well thats another desperate idea gone...
I'll try the timing trials.
I've tried the circuit with the Crystal (4MHz), everything seems to be the same...
Attached is the circuit diagram, could someone please check it to see what I am doing wrong please???
The LED blinks if the serial port is not connected to the computer.
The LED doesn't blink if the serial port IS connected to the computer, so I'm thinking its a grounding problem. Any suggestions?
This is the code that I am testing with:
Code:PORTA = 0 PORTB = 0 CMCON = 7 'Set 16F628A Comparators off Include "modedefs.bas" light var PORTB.0 Low light Start: Toggle light SerOut PORTA.1,N300,["Pulse",10,13] Pause 100 goto Start High light end
You show VSS = -5V on your sketch. It should be VSS = 0V
ALso, If you have nothing between your +5.0V power supply and your PIC, then you should measure +5.0V between VDD and VSS on your PIC (not 3.5V).
EDIT: it sounds like a grounding problem just like you suspected
Last edited by paul borgmeier; - 21st April 2007 at 07:13. Reason: see EDIT:
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Well by -5V, I mean the negative side of the power supply.
This is the power supply I'm using (pretty cheap and nasty, but I thought it would do the job (it did for a while)).
http://www.jaycar.com.au/productView...Max=&SUBCATID= - Model MP-3144 (the first one listed).
...I don't know what switchmode means...
Switchmode...hmmmm...maybe there's not enough load on the circuit to turn on the regulator in the PSU, which is sometimes needed for those things. I'd try a battery pack next, even a 9v battery with a 7805 will do for awhile.
P.S. - quick lesson in PSU's
Linear power supply - you put in 10v, you want to draw 5v @ 1 amp. The regulator dumps 5v @ 1 amp overboard as heat and saves the other 5v for your output. In this case, it's only 50% efficient.
Switchmode - you put in 10v, you want to draw 5v @ 1 amp. The 'switcher' basically turns a MOSFET on and off really fast (sometimes as high as a few Mhz) thru an inductor to keep an output cap charged up to 5v. Sometimes these types can hit about 98% efficiency, very little wasted heat. Drawbacks are that you have to draw a little bit to keep the regulator regulating and they introduce a little bit of noise on the output (a very little bit, usually not enough to mess with anything).
Last edited by skimask; - 21st April 2007 at 07:28.
I've tried with and without a resistor on the Rx and Tx Pin, there's no difference.
Does it make sense that the serial port seems to be sucking the life out of the circuit...?
No, but it makes sense that without the resistor, you probably smoked all of your ports.
But...back to the timing thing. The LED blinks, ok... Back to basics...
Do you have an LCD? Make a counter, one second, power up the PIC, start your stopwatch. Wait for 100 seconds. If your watch and the PIC/LCD match up after 100 seconds, you can be reasonably sure you're within 1-2% of the 4Mhz clock speed. The longer you go, the more accurately you can count it up.
I'm using the same COM port to program the PIC using JDM2 serial programmer and WinPic - there are no errors there, so the COM port should be fine!?
I just did a Pause command of 2mins, timing it showed up as 2mins 2secs. Is this too far out?
But all of your PICs might not be! Or at least none of the ports you've hooked up to. Maybe not just PortA.1, but all of PortA, heck for that matter, maybe the whole chip. I don't know why...just maybe...
Nah, I'd chalk that amount of error up to you not clicking quite right on time, maybe a couple ms here and there in the program, etc.etc., ya know, all those things adding up. I'd say your clock is good within say 1-3%, far close enough for 300 baud, and probably up to 2400 baud.I just did a Pause command of 2mins, timing it showed up as 2mins 2secs. Is this too far out?
Bookmarks