Author |
Message |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Fri Jul 09, 2010 5:38 am Subject: ADC and PWM Problem |
Your problem though is INT_RB. INT_RB, reflects a hardware 'event', that there is a character waiting in the serial buffer. It will _continuously_ trigger, untill this hardware event is stopped (rea ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Fri Jul 09, 2010 1:57 am Subject: ADC and PWM Problem |
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
char BK,yedek;
long led_res,old_led_res,led_res_iki,i;
int8 value;
unsigned flag_PWM_stop,okuma_b,timer_ba ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Fri Jul 09, 2010 1:15 am Subject: Adding İnterrupt :( |
ADC and PWM works now. Thanks for your help. I've changed my adc and pwm to 10bit. Also changed the code little bit and its ok now.
But I have another problem. I add interrupt to my code and when I ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 2:43 pm Subject: ADC and PWM Problem |
I did but duty is not linearly increase :( When i declare as long then there is linearity |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 7:25 am Subject: ADC and PWM Problem |
You declared Led_res as type long. This means the compiler will use 10 bit pwm mode instead of 8 bits. What this means is that the duty cycle that you will get is actually 1/4 lower than what you in ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 6:28 am Subject: ADC and PWM Problem |
I uploaded a video from oscilloscope
http://rapidshare.com/files/403524343/MOV00007.3gp.html
The waveform you see is from pic output (one of the CCP modules). My camera is not so qualified fo ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 4:32 am Subject: ADC and PWM Problem |
Also i should say that i see that blinking or flickering problem obviously when there is no delay. If i put a delay, i see that problem rarely but i see it.
One more thing; whatever i do, this pro ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 4:05 am Subject: ADC and PWM Problem |
Here is the code part that makes the blink problem.
The main idea is; to read from adc, generate PWM with appropiate duty, then to read adc again. It continues forever. If adc value is 255 i stop p ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Fri Jun 25, 2010 5:28 am Subject: ADC and PWM Problem |
I tried it in hardware. ADC works Then i tried my first code ADC+PWM. That code was actually driving leds with pwm. I saw there little pwm duration increasement but it happens very rarely. Th ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Fri Jun 25, 2010 3:12 am Subject: ADC and PWM Problem |
Thank you very much PCM programmer. My problem is solved at isis Today ill try it on hardware i hope there wont be a problem too
By the way what does clobbering means? I didn't understand ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Wed Jun 23, 2010 1:56 pm Subject: ADC and PWM Problem |
I am using 1k but I saw the same problem at 10k and 500 ohms too |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Wed Jun 23, 2010 8:20 am Subject: ADC and PWM Problem |
I realize that my potentiometer is the problem. When i apply any voltage level to AN0 pin without potentiometer, there is no problem with adc. But with pot, it doesnt apply linear voltage level and ad ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Wed Jun 23, 2010 7:46 am Subject: ADC and PWM Problem |
I'm sorry i was trying those and i forgot them before copying. I have changed the code as u told me. Here is the new one :
#include <ctype.h>
#include <float.h>
#include <st ... |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Wed Jun 23, 2010 7:31 am Subject: ADC and PWM Problem |
Also can u plz tell me how can i see adcon1 register bits in ccs ? |
Topic: ADC and PWM Problem |
CCS_Kid
Replies: 26
Views: 19941
|
Forum: General CCS C Discussion Posted: Wed Jun 23, 2010 6:44 am Subject: ADC and PWM Problem |
Ok. I wrote 63 instead of 124. But i think that my problem is in adc. I created a new project and tried only adc.
#include <ctype.h>
#include <float.h>
#include <stddef.h& ... |
|