PDA

View Full Version : Debugin



tbh9365
- 14th January 2008, 17:28
I'm new so I tried to search for the answer on the forum but couldn't find it.
I am trying to send info from one pic (pic16F84A) using the debugin command.
I debug the info from the pic16f84a and it is being sent. I then try to get the
other pic, (pic16f684) to place the info into a variable and then debug it to the serial communicator.
I get nothing. If I remove the debugin command then the pic 16F684 debugs all the
other info correctly. I have defined the debugin_bit as another pin and I have tried
leaving it as the default bit. Any suggestions would be appreciated.

Thanks

skimask
- 14th January 2008, 18:02
I'm new so I tried to search for the answer on the forum but couldn't find it.
I am trying to send info from one pic (pic16F84A) using the debugin command.
I debug the info from the pic16f84a and it is being sent. I then try to get the
other pic, (pic16f684) to place the info into a variable and then debug it to the serial communicator.
I get nothing. If I remove the debugin command then the pic 16F684 debugs all the
other info correctly. I have defined the debugin_bit as another pin and I have tried
leaving it as the default bit. Any suggestions would be appreciated.

Thanks

Could be that your debugin_bit pin is actually a power or a ground pin.... Or that your car hasn't been repainted in the last 4 years...

Actually, we don't know and can't possibly know, because you haven't included any relavant information that would help us to diagnose your problem.

But since you say you are using a 16F684, how about the analog inputs? How about the comparator pins?
Are the analog pins selected as analog, as they are by default, or have you switched them over to digital inputs in your program?
Is the comparator module turned off?
Do you have the keywords ANSEL and/or CMCON0 in your program anywhere?

tbh9365
- 14th January 2008, 19:07
I am using the adcin command for my anolog inputs, and the debuggin command should
make the pin an input. I don't have cmcono or ansel in my program anywhere.

skimask
- 14th January 2008, 20:18
I am using the adcin command for my anolog inputs, and the debuggin command should
make the pin an input. I don't have cmcono or ansel in my program anywhere.

Oh, DEBUG will make the pin an input all right, but only if the pin is selected as an input.
Read the datasheet for the 16F648, page 31 of DS41202F, the note highlighted on the right side of the page.

tbh9365
- 14th January 2008, 21:39
I don't understand how to set these registers, I have the RA1 pin set as Vref,
and RA0,RA2,RA3,RA5 as anolog inputs. I am trying to use RA4(an3) as the debugin
pin. My registers are set as follows:

cmcon0 = %11110000
ansel = %10101
adcon0 = %01001000

How far off am I? And what do I need to change?

Thanks

skimask
- 14th January 2008, 22:08
I don't understand how to set these registers, I have the RA1 pin set as Vref, and RA0,RA2,RA3,RA5 as anolog inputs. I am trying to use RA4(an3) as the debugin pin. My registers are set as follows:
cmcon0 = %11110000
ansel = %10101
adcon0 = %01001000
How far off am I? And what do I need to change?
Thanks

And more information that would've been a lot more helpful much earlier in the process...

You're trying to use RA4/AN3 as a digital input, which means you aren't using it as OSC2 or a Fosc/4 clockout, which means you are most likely using the internal oscillator, which means that it may need to be tweaked a bit to get the baud rate correct (see OSCTUNE)...and do a search on that term.

Am I about right here?

tbh9365
- 14th January 2008, 22:14
You are correct, I am using the internal Osc. on the Pic 16F684, and a Ceramic Resonator on
the Pic 16f84A, of 4mhz, And the internal Osc should be 4mhz also on the 684, I will double
check this. I will also read up on the tuneing and give it a try. Thanks again