CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Re: Output Pin Oscillating

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
John Kennedy
Guest







Output Pin Oscillating
PostPosted: Tue Nov 06, 2001 10:12 am     Reply with quote

I have written my 2nd Program for the 16C710 and have encountered output pins oscillating when given the output_low or output_high command. I have 10K pullups to the 5V rail on each pin. I'm using a 200Khz RC Oscillator the frequency the output pins oscillate at is 3.9Khz does anyone have any idea how to correct this. I have included a portion of the code that I have used to see if you can spot what I'm missing.

#define connect 125
#define vmin 50
#define minamp 3
#define almost 72
int batt,volt,amp;
int charged();

void main() {

setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_DIV_2);
setup_counters(RTCC_INTERNAL,RTCC_DIV_2);

start:

output_high(PIN_B1);
output_high(PIN_B2);
output_high(PIN_B3);
output_high(PIN_B4);
output_high(PIN_B5);
output_low(PIN_B6); //pin works as it should here

do
{
set_adc_channel(0);
delay_us(100);
batt = read_adc();
}
while (batt > connect);

output_high(PIN_B6);

do
{
set_adc_channel(1);
delay_us(100);
volt = read_adc();
}
while (volt < vmin);
//all these pins oscillate at this point
output_low(PIN_B1);
output_low(PIN_B2);
output_low(PIN_B4);


Any help appreciated

Thanks

John Kennedy
___________________________
This message was ported from CCS's old forum
Original Post ID: 982
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: Output Pin Oscillating
PostPosted: Tue Nov 06, 2001 1:23 pm     Reply with quote

:=I have written my 2nd Program for the 16C710 and have encountered output pins oscillating when given the output_low or output_high command.
----------------------------------------------------------

What do you have connected to each of the port B pins ?
(list all components).
___________________________
This message was ported from CCS's old forum
Original Post ID: 986
John Kennedy
Guest







Re: Output Pin Oscillating
PostPosted: Wed Nov 07, 2001 2:11 am     Reply with quote

:=I have written my 2nd Program for the 16C710 and have encountered output pins oscillating when given the output_low or output_high command. I have 10K pullups to the 5V rail on each pin. I'm using a 200Khz RC Oscillator the frequency the output pins oscillate at is 3.9Khz does anyone have any idea how to correct this. I have included a portion of the code that I have used to see if you can spot what I'm missing.
:=
:=#define connect 125
:=#define vmin 50
:=#define minamp 3
:=#define almost 72
:=int batt,volt,amp;
:=int charged();
:=
:=void main() {
:=
:= setup_adc_ports(ALL_ANALOG);
:= setup_adc(ADC_CLOCK_DIV_2);
:= setup_counters(RTCC_INTERNAL,RTCC_DIV_2);
:=
:=start:
:=
:= output_high(PIN_B1);
:= output_high(PIN_B2);
:= output_high(PIN_B3);
:= output_high(PIN_B4);
:= output_high(PIN_B5);
:= output_low(PIN_B6); //pin works as it should here
:=
:= do
:= {
:= set_adc_channel(0);
:= delay_us(100);
:= batt = read_adc();
:= }
:= while (batt > connect);
:=
:= output_high(PIN_B6);
:=
:= do
:= {
:= set_adc_channel(1);
:= delay_us(100);
:= volt = read_adc();
:= }
:= while (volt < vmin);
:=//all these pins oscillate at this point
:= output_low(PIN_B1);
:= output_low(PIN_B2);
:= output_low(PIN_B4);
:=
:=
:=Any help appreciated
:=
:=Thanks
:=
:=John Kennedy


----------------------------------------------------------

I don't have anything at the moment only a 10K pullup resistor to the 5V rail. I'm just testing the program to get it to do what I want it to. When it works the pins will be connected as follows.

RB1 - series 4k7 resistor to a gate of a 2N7000 signal mosfet.
RB2 - connected to the reset pin of a HEF4521 binary counter.
RB3 - connected to the output pin of the HEF4521.
RB4 - Cathode of an LED(LED on when pin low).
RB5 - as RB4.

All other pins floating.

If you can see any other potential problems please let me know.
___________________________
This message was ported from CCS's old forum
Original Post ID: 995
Sherpa Doug
Guest







Re: Output Pin Oscillating
PostPosted: Wed Nov 07, 2001 8:17 am     Reply with quote

:= while (volt < vmin);
:=//all these pins oscillate at this point
:= output_low(PIN_B1);
:= output_low(PIN_B2);
:= output_low(PIN_B4);

Is your +5 supply stable? Maybe one of these outputs is shorted to +5, or one of the pullups is much smaller than 10k, and the output going low causes the processor to hiccup. Try only setting one pin at a time to see which one is the culprit.
___________________________
This message was ported from CCS's old forum
Original Post ID: 1000
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group