I didn't think that I changed Bruce's code, except for direct serial, but it's good to get more than one set of eyes on it. I'll keep checking connections; it's got to be the hardware. Thanks again y'all!
~ Dave
I didn't think that I changed Bruce's code, except for direct serial, but it's good to get more than one set of eyes on it. I'll keep checking connections; it's got to be the hardware. Thanks again y'all!
~ Dave
Dave,
Are you getting anything from DEBUG, or is it just not showing any change in temp?
If DEBUG is showing a fixed value even when the temp changes, the sensor may be wired
wrong.
If you're using a boot-loader;
1. It most likely has the USART enabled, so you may need to disable the USART to use the
USART TX pin with DEBUG.
2. If your serial connection is through a MAX232 inverter, then you need to use mode 0
with DEBUG for non-inverted serial.
3. Most boot-loaders don't allow you to change config settings, so embedding them in your
code isn't necessary. And the loader might have some config settings different than what
you expect.
Hi Bruce, no, I'm getting no DEBUG from the board.
I'm connected to the serial port through a 1k resistor which is why I have debug mode at 1.
How do I disable USART? TXSTA=0?
RCSTA = 0 should do it. You just need to clear RCSTA.7 (SPEN) to disable the USART.
With a direct connection, make sure you have a common ground connection between your
board & the PC serial port.
No change when USART disabled.
I'm pretty sure that it's a connection. I tried the code straight up except for debug mode at 1 and received 7 lines of temperature in Hyper Terminal, then it stopped.
Going back to double check everything.
~ Dave
Darrel most likely hit the nail on the head. Sounds like some odd hardware problem, or a
bad connection.
Troubleshoot things one-at-a-time, and just setup a simple loop shooting serial data to
your PC serial port until you get the serial com thing working.
If it goes-like-splat, then you know there's a bad connection - or maybe even a problem
with your PC serial port.
Note: It might even be a problem with the PIC itself if the A/D is foo-bar. The ADCIN library
function is a blocking type with;
adcinloop
btfsc ADCON0, GO_DONE ; Wait for conversion to complete
goto adcinloop
If ADCON0, GO_DONE never gets cleared, it's a sit & spin function call...;o}
Bookmarks