Searching \ for '[PIC]: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: '16F628'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:16F628'
2001\03\08@043606 by Peter Grey

picon face
I am running this chip in the internal 4Mhz mode. I am looking at RA1 with
an input signal train swinging between 0 & 3 volts as observed on a CRO. I
cannot get the program to recognise a high level. The chip is powered from
5 volts. I have set the CMCON register to 0x07. The TRISA&B are set ok as
well. The offending code is posted below.
The program never reaches NEXT1. I can look at the pin (RED_LED) and it
continuously pulses even when RXD is high.The WDT is not enabled; the
supply is good and solid, there is no noise that I can see.
Any insight would be appreciated.

Peter


NO_PULSE1       CLRF    PULSE_COUNT

NO_PULSE
               BTFSC   RXD             ;IS IT A LOW
               GOTO    NO_PULSE        ;NO, GO BACK AND TRY AGAIN
               CALL    SCAN_DELAY      ;DELAY FOR 50uS
               BTFSC   RXD             ;LOW STILL
               GOTO    NO_PULSE        ;NO, MUST HAVE BEEN NOISE
               CALL    SCAN_DELAY      ;CHECK AGAIN
               BTFSC   RXD             ;LOW STILL
               GOTO    NO_PULSE        ;NO, MUST HAVE BEEN NOISE
NEXT2           CALL    SCAN_DELAY      ;DELAY AGAIN
               BTFSC   RXD             ;LOW STILL?
               GOTO    NEXT1           ;NO
               INCF    PULSE_COUNT,    ;COUNT THE NUMBER OF TIMES IT IS HIGH
               BSF     RED_LED         ;FOR TESTING ONLY
               BCF     RED_LED
               GOTO    NEXT2
NEXT1           BSF     GREEN_LED
               NOP
               NOP
               NOP
               NOP
               NOP
               NOP
               NOP
               NOP

               BCF     GREEN_LED

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\03\08@105934 by Mike Mansheim

flavicon
face
> I am running this chip in the internal 4Mhz mode. I am looking at RA1
> with an input signal train swinging between 0 & 3 volts as observed on
> a CRO. I cannot get the program to recognise a high level. The chip is
> powered from 5 volts.

I worry that I'm missing something when a reason seems simple, but...
According to the 16F628 data sheet, RA1 is a schmitt trigger input, which
means an input high must be at least 0.8Vdd, which would be 4V.  So the
3V simply isn't high enough.
Note that this is different from a chip that I use a lot (F87x), where
most of portA, including RA1, are TTL inputs, where the 3V would be a
logic high.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\03\08@195142 by Peter Grey

picon face
At 09:54 AM 3/8/2001 -0600, you wrote:
>> I am running this chip in the internal 4Mhz mode. I am looking at RA1
>> with an input signal train swinging between 0 & 3 volts as observed on
>> a CRO. I cannot get the program to recognise a high level. The chip is
>> powered from 5 volts.
>

I find that usually the reason is simple when a problem occurs. I guess we
are always looking for the obscure reasons. Anyway thanks a heap for this.
It has been annoying me for a few days.

Peter
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


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