[PIC] Weird PWM output voltage range with PIC18F4580

Status
Not open for further replies.

mustafahasan

Newbie
Joined
Jul 26, 2018
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
91
Hi...
Please I need help, with PIC18F4580.
I am using mikroc with 0.1Mhz with this simple code. the question is why my min and max output voltage in the oscilloscope (i am using proteus) are -2.5v and 2.5v? not 0 and 5 v??

void main()
{
trisc.b2=0; portc.b2=0;
pwm1_init(50000); delay_ms(200); pwm1_start();
while(1)
{
pwm1_set_duty(128);
}
}
 

Attachments

  • problem.png
    115.9 KB · Views: 79

Hi,

Because you used AC input setup instead of DC input setup.

Klaus
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…