CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 16 matches
CCS Forum Index
Author Message
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sun Jan 25, 2015 2:54 pm   Subject: PIC18F46K20 PWM not working
Yes BUT you MUST use a resistor to connect PIC to base of transistor !!
I'd suggest a 470r or 1K to start.
Typically you use an NPN transistor, with emitter connected to ground, 1K resistor from ba ...
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sun Jan 25, 2015 9:58 am   Subject: PIC18F46K20 PWM not working

Normally these days you use a 'logic level FET' to drive fans. PIC I/O pin to gate, FET source to ground, drain tied to fan -ve, fan+ to +5V.


I know, but I don't have one of them, can I use a t ...
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sun Jan 25, 2015 9:35 am   Subject: PIC18F46K20 PWM not working
Post a schematic of what you are doing. Either put a picture up on a site (free or otherwise), and post a link to this, or do an ASCII text schematic.
https://dl.dropboxusercontent.com/u/53376851/Imm ...
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sun Jan 25, 2015 7:16 am   Subject: PIC18F46K20 PWM not working
on the pwm output I've connected a transistor, and removed the led.
The pwm signal enables the transistor on a 5v line, so I get a 5v pwm signal on the output.
on the program, if I set C2 (pwm) high ...
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sat Jan 24, 2015 10:59 am   Subject: PIC18F46K20 PWM not working
The reason it is failing, is you are overloading the PIC.

No current limiting resistor = PIC port shorted to LED forward voltage max. Result overload. As you turn up the duty, the overload gets bad ...
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sat Jan 24, 2015 10:01 am   Subject: PIC18F46K20 PWM not working
#include <18F46K20.h>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP,
#use delay(clock = 4000000)

main()
{
setup_oscillator(OSC_8MHZ);
output_c(0 ...
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sat Jan 24, 2015 9:37 am   Subject: PIC18F46K20 PWM not working
So, have you first verified the chip actually works?.
Flashed an LED just using output_high/output_low?.
MCLR pulled high?.
What current limiting resistor have you got on the LED?.
the lcd works, ...
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sat Jan 24, 2015 9:27 am   Subject: PIC18F46K20 PWM not working
You seem to have some pin confusion.

You are half setting up CCP1, then trying to use CCP2....
You haven't setup CCP2 as a PWM.
Also CCP2, needs to be told which pin it is to use (CCP2C1 fuse).
...
  Topic: PIC18F46K20 PWM not working
Ellest96

Replies: 16
Views: 21359

PostForum: General CCS C Discussion   Posted: Sat Jan 24, 2015 8:57 am   Subject: PIC18F46K20 PWM not working
Hi everyone!
I'm building a speed regulator for a fan on my desk, with a pic and a display.
For the speed, I want to use PWM over a transistor.
So, I built #include <18F46K20.h>
#fuses XT, N ...
  Topic: MikroE TFT ProtoBoard
Ellest96

Replies: 0
Views: 5226

PostForum: General CCS C Discussion   Posted: Mon Dec 16, 2013 11:23 am   Subject: MikroE TFT ProtoBoard
I've bought this (http://www.mikroe.com/add-on-boards/display/tft-proto/) tft display from the mikroe store, it have the ILI9341 controller.
There is a library for that?
  Topic: MPLABX and CCS led blink not as I want
Ellest96

Replies: 11
Views: 14861

PostForum: General CCS C Discussion   Posted: Sat Nov 16, 2013 7:49 am   Subject: MPLABX and CCS led blink not as I want
now all works perfectly!
http://pastebin.com/2MxXpBtd
I don't know why before I had problems.
  Topic: MPLABX and CCS led blink not as I want
Ellest96

Replies: 11
Views: 14861

PostForum: General CCS C Discussion   Posted: Sat Nov 16, 2013 5:43 am   Subject: MPLABX and CCS led blink not as I want
so, I've modified the program...
http://pastebin.com/7ziSy40G
the problem is the same:
-6 main leds blink one time.
-LED7 blinks as he wants.
  Topic: MPLABX and CCS led blink not as I want
Ellest96

Replies: 11
Views: 14861

PostForum: General CCS C Discussion   Posted: Sat Nov 16, 2013 1:29 am   Subject: MPLABX and CCS led blink not as I want
Oops...
This afternoon i will test the program with that.
  Topic: MPLABX and CCS led blink not as I want
Ellest96

Replies: 11
Views: 14861

PostForum: General CCS C Discussion   Posted: Sat Nov 16, 2013 12:32 am   Subject: MPLABX and CCS led blink not as I want
By making one while with the code from the variables of the buttons to the end.
Delete lines from 64 to 68.
  Topic: MPLABX and CCS led blink not as I want
Ellest96

Replies: 11
Views: 14861

PostForum: General CCS C Discussion   Posted: Fri Nov 15, 2013 4:52 pm   Subject: MPLABX and CCS led blink not as I want
If i put all the code in one while(1) the problem is the same.
 
Page 1 of 2 Goto page 1, 2  Next
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group