Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PICF506 square wave pulse through I/O port, not pulse

Status
Not open for further replies.

chanchal.chauhan

Full Member level 4
Joined
Apr 23, 2009
Messages
216
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Location
Hyderabad, India
Activity points
2,539
Hi,

I am using pic 16f506 microcontroller.

Here I am generating square wave pulse through I/O port. But if I will short RC3 & RC2 I am not getting pulses.
Here I am using all port as a o/p port.

Please help me to solve the problem.

Regards
Chanchal Chauhan
 

PICF506 I/O port problem

Hi,
Make sure you pull-up RB3/MCLR high with a resistor (around 10k). You didn't show that in the circuit.
You forgot to connect Vss pin to Gnd in the circuit.
Which pin are you using for square wave output? (Not shown in circuit).
Why is RB2 connected to RC2?
Why are you trying to short RC2 and RC3?
Are you using RC0 for comparator voltage reference? If so, have you set the comparator properly?
Tahmid.
 
Re: PICF506 I/O port problem

Dear Tahmid.

I am using RB3/MCLR function as a RB3
Yah I forgot to connect Vss pin to gnd.
I am using RC2, RB2, & RC3 for pulses.
I have shorted RC2, RB2, & RC3 to increase the current capability because we have 3 LED in Parallel.
We are not using RC0 as a comparator voltage reference.

Chanchal
 

PICF506 I/O port problem

Hi,
I think I notice the problem.
Don't short the outputs (RC2, RB2 & RC3), I don't think you should be doing that.
Use whichever one pin without shorting and then use a transistor to drive the 3 LEDs in parallel.
40_1263993510.jpg

Try this and let me know if it works.
Tahmid.
 
Re: PICF506 I/O port problem

Dear Tahmid,

The information which i have given you is correct. Actually in a real project we are shorting all Port pins except RB5 & RB3 which we are using for Analog channel & one for switch. There we are connecting 5 High power LEDs which sinked 100mA of current.
This project already implemented but we don't have source code (only machine code). So that is why we are planning to generate a source code in C.

If we give all ports as output port & short all are going to be 0v. But in old code if we short all the ports we are getting pulses not 0v.

My assumption is in old code they are using some port bit as input port & some port bit as output port.

Please give me some clue.


Thanks & Regards
Chanchal
 

PICF506 I/O port problem

Hi,
I think this is what could have happened:
When you are shorting the pins, you are generating pulse on only one pin and shorting that with other port pins, which are already set low to 0v. Thus you are not getting output.
But in old code the same pulse is generated on all the pins and thus when shorted, no problem is created.
As a fix, try generating the same pulse on all the pins and THEN short them. I think this will work.
Tahmid.
 
Re: PICF506 I/O port problem

That is not the case i am generating same pulses with all the ports & initializing o/p ports. But at the time of shorting it is going to 0v.

Ok I will check same case with different microcontroller & let you know soon.


I have checked with PIC18F1330 with 2 o/p ports. But when i will short two ports RB4 & RB5 it is going to 0v.

Please help as guy to solve the issue.

Regards
Chanchal
 

PICF506 I/O port problem

Hi,
So your situation is:
You have set everything up properly.
You are generating pulses on all port pins and THEN shorting them.
When you test individually, everything's fine, but shorting causes no output.
Odd.
Have you turned off the ADC module? If not do so:
Code:
ADCON1 = 0x7F
Ok, I can't seem to understand why this problem persists.
Instead of directly shorting them, why not try connecting them to each other with 10ohm resistors and see what happens?
Tahmid.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top