Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 9th November 2003, 12:31 PM   (permalink)
Default pic16f628: can't use MCLR pin for I/0!

I disable MCLR by configuration bits,
__CONFIG _INTRC_OSC_NOCLKOUT & _MCLRE_OFF

then type

movlw 0x07
movwf CMCON
bcf STATUS, RP1
bsf STATUS, RP0
MOVLW 0xff
MOVWF TRISA

but TRISA register is not affected on bit 5, and i can not use PORTA bit 5 for input. Why? Microchip datasheet says that bit 5 supports input, if you disable MCLR. Currently i am working on Mplab IDE 6.30 - the chip has the same problem, or is it a software bug? (i noticed that checking the model pic16f628A does not correct the problem)
ramantas is offline  
Old 9th November 2003, 12:51 PM   (permalink)
Default

Seems like your config word isn't assembled right

Try __CONFIG 0x3D18
Exo is offline  
Old 9th November 2003, 06:08 PM   (permalink)
Default

thanks for the reply, but your hint doesn't seem to solve the problem. Anyways, I am planning to connect a 4*4 keypad matrix and an LCD screen to the PIC, so the number of I/O pins is a bit of an issue. Is there anything else I could try to disable MCLR?
ramantas is offline  
Old 9th November 2003, 06:51 PM   (permalink)
Default

Did you already try it for real? or just simulation.
I burnt a 16F628A here to try and read a switch on MCLR and it works...
Maybe a simulator bug
Exo is offline  
Old 10th November 2003, 08:34 AM   (permalink)
Default

Well, you' ve been a great help Exo! No, i hanen't tried this for real yet (no programmer available at this time). I guess I' ll try it again on the MPLAB 6.32 interim release
ramantas is offline  
Old 10th November 2003, 07:27 PM   (permalink)
Default

How do you reprogram after MCLR is set to input?
justin_sane is offline  
Old 10th November 2003, 11:40 PM   (permalink)
Default

By making it 14V pic will go to programmer mode - regardless of how the pin is configured
Exo is offline  
Old 11th November 2003, 02:40 AM   (permalink)
Default

I program using LVP.

I guess that is out if you are operating in that mode.
justin_sane is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 03:39 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker