As I remember, they MCLR pin can be used as input (not as output), but I've never really tried to use it.What about the I/O pins that also share the MCLR?
As I remember, they MCLR pin can be used as input (not as output), but I've never really tried to use it.What about the I/O pins that also share the MCLR?
Don't imagine it is fixed yet.Thanks a lot; I was already giving it for impossible and looking for ways to just write the whole word every time.
I set the port to digital and now is working without problems. But why this didn't happen with the other PIC; nor with any other example I saw, since I never saw one using ANSEL first?
Yes, you're right. Thanks for that.See the documentation.
RA5 can be used only as input.
That's what I was planning to do, but then I found about setting the outputs to digital and it worked fine; since I'm changing the values of the outputs at speeds I can see through the LEDs.Don't imagine it is fixed yet.
If you are running at a high speed and you set a bit on PORTx in adjacent instructions, you still might see it misbehave. The only safe way to write to PORTx on PICs without a LATx is to keep a shadow register that contains all of the output bits set properly and copy that to the PORT.
So, to write a bit to the port you would:
ShadowA |= 1 << BITNUM;
PORTA = ShadowA
Or to clear on:
ShadowA &= ~(1 << BITNUM);
PORTA = ShadowA;
Bob
Who would've thought ...I already came across a PIC that will not run with the PICkit2; and it's precisely the one I was going to use for the project.
If you want to drive LEDs with these pins, a good idea is to use a small BJT such as 3904. This way you only need few mA of current. Connect 1-2K resistor to the base, connect emitter to the ground, and connect the LED along with current-limiting resister between collector and Vdd.So, what's the right way to isolate those 2 pins between my application and the programmer? Do I have no choice but to remove the LEDs every time I program it?
More than running out of pins, I was trying to keep a group of 8 LEDs on the same port; as I can't do it on the other port (A) because it also has some input only pins.If you want to drive LEDs with these pins, a good idea is to use a small BJT such as 3904. This way you only need few mA of current. Connect 1-2K resistor to the base, connect emitter to the ground, and connect the LED along with current-limiting resister between collector and Vdd.
Unless you're running out of pins the best idea is to avoid using these pins.
It doesn't recognize the PIC16F1459. I also tried to select it manually but it was not on the list.Did you try the PICKIT 2 stand alone app? It supports a lot of PICs that are not supported in MPLAB. I use the pic12f1840 and the pic16f1507, both of which are enhanced midrange and are supported by the stand-alone app but not by MPLAB.
That said, I just finally broke down and ordered a PICKIT 3 because I am starting a big project that I will want to use in-circuit debug though MPLAB.
Bob
Is there any particular reason you want to keep 8 LEDs on the same port? It shouldn't be a problem to control LEDs from different ports.More than running out of pins, I was trying to keep a group of 8 LEDs on the same port; as I can't do it on the other port (A) because it also has some input only pins.
I just find it faster and simpler to assign the LED patterns to display if they are on the same port; I just assign an unsigned char to the port and that's it. With two ports I would need to assign the patterns twice.Is there any particular reason you want to keep 8 LEDs on the same port? It shouldn't be a problem to control LEDs from different ports.
Unless you have a need for speed (couldn't be the case with LEDs), assigning twice (or even every bit separately) is easier/cheaper than adding extra circuity to the board.I just find it faster and simpler to assign the LED patterns to display if they are on the same port; I just assign an unsigned char to the port and that's it. With two ports I would need to assign the patterns twice.
True, so what I'm doing is to temporarily disconnect the 2 LEDs on the PGD and PGC pins while programming and testing.Unless you have a need for speed (couldn't be the case with LEDs), assigning twice (or even every bit separately) is easier/cheaper than adding extra circuity to the board.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
H | Power over coax circuit doubts | General Electronics Chat | 0 | |
Doubts regarding a CS5530 ADC circuit | Analog & Mixed-Signal Design | 0 | ||
K | some doubts about 8051 mcu | Microcontrollers | 22 | |
Quick doubts on FinFET | General Electronics Chat | 7 | ||
T | About non persistent (parallel and serial) http connections doubts-: | Homework Help | 6 |