Or the config fuses are not set correctly, or the OSC speed is not the right one OR the MAX232 circuit is bad OR there's a little hardware problem, OR the serial communicator is not set properly OR all DEFINEs are not written in UPPERCASE.
Bellow is tested and work on a 16f877.. but it shouldn't make any difference whatever PIC you're using...
Code:
define OSC 12
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_SPBRG 77 ' 2400 Bauds
DEFINE HSER_CLROERR 1
START:
hSEROUT ["HELLO, THIS IS A TEST",13,10]
PAUSE 100
GOTO START
Yep, all chips have a 104 Cap near-by. Hold fire a while on this problem chaps. I tried programming an EPROM version of the processor instead of using my beloved ICEPIC2, and I am getting nothing happening, unfortunetly I have to go out now, but will continue tomorrow.
Appologies are due, especially to Steve and Matt. I made the fundamental mistake of believing what I was being told, a colleague said he had given me a known working board. The problem was the Loading Caps on the Oscillator crystal were of the wrong value (too high a value) which were not enough to completely cripple my ICEPIC2 but were enough to affect the speed.
I am now getting comms. and I did that thing of jumping up and down when the word "hello" appeared in Serial Communicator.
Thanks to everybody who helped and sorry if I wasted your time.
Just as a side issue, I plugged my ICEPIC2 back in, and I got garbage out again, on checking I find that ICEPIC2 uses its own clock of 4Mhz, (in my defence I got this secondhand so I do not have the manual) 4Mhz is the frequency I normally use on my PIC projects, so it has not been an issue before. Anyway just changed the crystal to 4Mhz, changed the settings in my code, run ICEPIC2 again and everything is working fine, so I am off and running, thanks to all.
Bookmarks