PDA

View Full Version : 16c72 and portc



Michael
- 7th August 2006, 21:35
Does PORTC on a 16C72 default to outputs or do I need to put in some sort of register command.

The port has multi functions I see......getting some wierd behavior on everything but C0 and C4.

If so, what do I include to make the port I/O pins?

Thanks

peterdeco1
- 8th August 2006, 10:25
Hi Michael. I use the 16C72A frequently. Now using 16F73 as a substitute. It is on a board that uses portc only as outputs and I never had a problem using any or all of them. This was at the top of my last program. Try this at the top of your program and see what happens:
ADCON1 = 7 'set inputs to digital
@ DEVICE WDT_ON, BOD_ON, PWRT_ON, PROTECT_ON
TRISA = %00110010 'RA1,4,5 INPUTS, REST OUTPUTS
TRISB = %11111101 'RB1 OUTPUT, REST INPUTS
TRISC = %00000000 'ALL OUTPUTS

Michael
- 8th August 2006, 14:44
this is very strange.....everything checks out....micro code studio shows 16C72....using EPIC for windows....power up timer on. (wdt makes no difference)

not only does it do this on the 2 new windowed chips I bought from digi key but some otp chips I have on the shelf.

I even did some ultra simple code with pulsout.

DEFINE OSC 4
ADCON1 = 7
TRISA = %11111111 (ALL TIED TO 10K PULLUPS)
TRISC = %10000000 (C7 IS AN INPUT)

START:
PULSOUT PORTC.0,5000 (Led's tied to C0 thru C6)
PULSOUT PORTC.1,5000
ETC to PORTC.6

GOTO START

I get a pulsout on C0 and C3 but nowhere else!!

Vss and Vdd are fine.....Led's are fine.

There are alot of functions for portc.....are you sure there isn't some register involved?

By the way, I've never put the device in the header.....I thought if it was chosen in MCS, that's all you need.

Michael
- 8th August 2006, 15:09
God Damnit !

I had some 1 meg resistors fall into my box of 560's or like an idiot saw green and brown and put them in the wrong box.

Try driving an LED with 1 meg.

$#&^ IT.

Another worthwhile post on my part.