Searching \ for '[PIC]: Problems with 16F628' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'Problems with 16F628'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Problems with 16F628'
2001\05\19@004312 by Peter Grey

picon face
I am looking at a pulse train coming in and have no problems when coding
with a 16C73A. I wish to use a 16F628 but it does not seem to work. I am
operating at 4MHz and have the XT option set. I do not have a WDT and am
only using the timer0 for an interrupt. It is such a simple program but I
am obviously missing something. The oscillator is OK and frequency is
correct. Power is OK (5 volts). The pulse train is 0-3 volts into RB5 which
is a TTL pin. I believe I have set all the required registers (CMCON is
loaded with 7). The configuration word looks OK. I am getting the correct
interrupts (every 100uS as I set an output pin and reset it) and this is OK
on an oscilloscope. Is there something funny with these chips I am missing?


TIA,

Peter

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\19@042437 by Roman Black

flavicon
face
Peter Grey wrote:
>
> I am looking at a pulse train coming in and have no problems when coding
> with a 16C73A. I wish to use a 16F628 but it does not seem to work. I am
> operating at 4MHz and have the XT option set. I do not have a WDT and am
> only using the timer0 for an interrupt. It is such a simple program but I
> am obviously missing something. The oscillator is OK and frequency is
> correct. Power is OK (5 volts). The pulse train is 0-3 volts into RB5 which
> is a TTL pin. I believe I have set all the required registers (CMCON is
> loaded with 7). The configuration word looks OK. I am getting the correct
> interrupts (every 100uS as I set an output pin and reset it) and this is OK
> on an oscilloscope. Is there something funny with these chips I am missing?


Why only 0-3 volts? This is a little out of spec,
normally cmos and TTL drivers make 3.5v, and 4v is
better. Try adding a 1k pullup resistor to that pin,
the driver circuit should be able to sink more than
it can source.

Also check the analog stuff, comparator setup etc.
Maybe input the pulses into a different pin and check
that.:o)
-Roman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\19@053202 by Peter Grey

picon face
At 06:20 PM 5/19/2001 +1000, you wrote:
>Peter Grey wrote:
>>
>> I am looking at a pulse train coming in and have no problems when coding
>> with a 16C73A. I wish to use a 16F628 but it does not seem to work. I am
>> operating at 4MHz and have the XT option set. I do not have a WDT and am
>> only using the timer0 for an interrupt. It is such a simple program but I
>> am obviously missing something. The oscillator is OK and frequency is
>> correct. Power is OK (5 volts). The pulse train is 0-3 volts into RB5 which
>> is a TTL pin. I believe I have set all the required registers (CMCON is
>> loaded with 7). The configuration word looks OK. I am getting the correct
>> interrupts (every 100uS as I set an output pin and reset it) and this is OK
>> on an oscilloscope. Is there something funny with these chips I am missing?
>
>
>Why only 0-3 volts? This is a little out of spec,
>normally cmos and TTL drivers make 3.5v, and 4v is
>better. Try adding a 1k pullup resistor to that pin,
>the driver circuit should be able to sink more than
>it can source.

According to the data sheet (yes, I know data sheets can be wrong!) the
high level for input voltages is 2 volts at Vdd=4.5 to 5.5 volts. My pic
chip is at 5 volts. I also enabled the weak pull ups but still the same. I
have set the CMCON register to 7 as it says for turning off all comparators
and enabling I/O pins. I have a 16C73AJW working fine.

>Also check the analog stuff, comparator setup etc.
>Maybe input the pulses into a different pin and check
>that.:o)

I have tried another pin but all the rest are Schmidt trigger inputs. I
will try the pull up resistor and see what happens.

Thanks for the help,

Peter
>-Roman
>
>--
>http://www.piclist.com hint: The PICList is archived three different
>ways.  See http://www.piclist.com/#archives for details.
>

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\19@120658 by Olin Lathrop

face picon face
> I am looking at a pulse train coming in and have no problems when coding
> with a 16C73A. I wish to use a 16F628 but it does not seem to work. I am
> operating at 4MHz and have the XT option set. I do not have a WDT and am
> only using the timer0 for an interrupt. It is such a simple program but I
> am obviously missing something. The oscillator is OK and frequency is
> correct. Power is OK (5 volts). The pulse train is 0-3 volts into RB5
which
> is a TTL pin. I believe I have set all the required registers (CMCON is
> loaded with 7). The configuration word looks OK. I am getting the correct
> interrupts (every 100uS as I set an output pin and reset it) and this is
OK
> on an oscilloscope. Is there something funny with these chips I am
missing?

What do you mean by "does not work"?  You are obviously getting the pulse in
and the processor is running if you get interrupts every 100uS.  What are
you finding in the simulator?  This sounds like it should be easy to track
down.

Note that 100uS at 4MHz oscillator is only 100 instructions.  A bare
interrupt requires about 15 instructions, so this leaves about 85
intstructions for all processing per pulse.  I have no idea what you are
doing with these pulses, so I don't know if that is a lot or a little.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\19@200152 by Peter Grey

picon face
At 09:09 AM 5/19/2001 -0400, you wrote:
>> I am looking at a pulse train coming in and have no problems when coding
>> with a 16C73A. I wish to use a 16F628 but it does not seem to work. I am
>> operating at 4MHz and have the XT option set. I do not have a WDT and am
>> only using the timer0 for an interrupt. It is such a simple program but I
>> am obviously missing something. The oscillator is OK and frequency is
>> correct. Power is OK (5 volts). The pulse train is 0-3 volts into RB5
>which
>> is a TTL pin. I believe I have set all the required registers (CMCON is
>> loaded with 7). The configuration word looks OK. I am getting the correct
>> interrupts (every 100uS as I set an output pin and reset it) and this is
>OK
>> on an oscilloscope. Is there something funny with these chips I am
>missing?
>
>What do you mean by "does not work"?  You are obviously getting the pulse in
>and the processor is running if you get interrupts every 100uS.  What are
>you finding in the simulator?  This sounds like it should be easy to track
>down.

Within the pulse train I am looking for certain sequences and I set an
output when this occurs. Works well on a 16C73A-JW, not the 16F628. I have
counted the instructions and I am well in the time period and it also works
OK on the 16C73A. I have not used the simulator yet but this is a task for
today as well as using a 0-5 volt signal rather than 0-3 volts.

Thanks,

Peter

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...