Author |
Message |
Topic: a strange problem |
mojsa2000
Replies: 9
Views: 10125
|
Forum: General CCS C Discussion Posted: Wed Oct 19, 2011 2:08 pm Subject: a strange problem |
Thanks for your attention.
I did it and it worked. I define a variable as signed int32 that supports -32760 to 32760. Then by "type casting", I did subtraction as you see.
Thanks again. |
Topic: a strange problem |
mojsa2000
Replies: 9
Views: 10125
|
Forum: General CCS C Discussion Posted: Wed Oct 19, 2011 8:45 am Subject: a strange problem |
Hi
thank you
I did it
delta=((signed int32 )input- (signed int32 )pre_in);
best regards |
Topic: a strange problem |
mojsa2000
Replies: 9
Views: 10125
|
Forum: General CCS C Discussion Posted: Wed Oct 19, 2011 6:51 am Subject: a strange problem |
Hi again
I read two values on RS232 Port as "input" and "step".
then last "input" value that stored on memory on previous level, is loaded as "pre_in" .then ... |
Topic: a strange problem |
mojsa2000
Replies: 9
Views: 10125
|
Forum: General CCS C Discussion Posted: Wed Oct 19, 2011 4:47 am Subject: a strange problem |
Dear RF_Developer
this is my function and definitions:
signed int16 pre_in,input,step,delta;
unsigned int16 step_in,pre_step;
signed int8 buffer[4];
int1 start_flag=0,int_flag=0,cal_fla ... |
Topic: a strange problem |
mojsa2000
Replies: 9
Views: 10125
|
Forum: General CCS C Discussion Posted: Wed Oct 19, 2011 3:54 am Subject: a strange problem |
Hi
I make a program with PIC16f877a. In one of functions when I subtract two values (for example : delta=32760-(-32760)) its result is odd because its result is -16.
delta=32760-(-32760)=-16
#in ... |
Topic: lookup table |
mojsa2000
Replies: 2
Views: 7225
|
Forum: General CCS C Discussion Posted: Sun Oct 16, 2011 3:12 am Subject: lookup table |
Hi
I want to make a look up table with 201 numbers. By CONST definition I made it but only 128 numbers is returned in main program. Please help me about maximum of look up table's elements.
My chip ... |
Topic: help about receive on RS232 |
mojsa2000
Replies: 2
Views: 4955
|
Forum: General CCS C Discussion Posted: Mon Aug 22, 2011 8:38 pm Subject: help about receive on RS232 |
Dear SherpaDoug
You're right. Thanks alot. I used your idea and my fault fixed.
best wishes |
Topic: help about receive on RS232 |
mojsa2000
Replies: 2
Views: 4955
|
Forum: General CCS C Discussion Posted: Mon Aug 22, 2011 6:04 pm Subject: help about receive on RS232 |
Hi
I have a question about RS232 communication. I use the #RDA_int and when
I receive a character (for example 'd') on this port I send an answer to
sender(PC) and wait to receive next byte. But P ... |
Topic: problem with a variable |
mojsa2000
Replies: 6
Views: 8726
|
Forum: General CCS C Discussion Posted: Mon Jul 25, 2011 12:45 pm Subject: problem with a variable |
Hi
Dear Ttelmah thanks for help.
I want to get an analog value every 400us. I want to read converted exactly after convertion because I need 4 real samples to estimate a harmonic of input signal by ... |
Topic: problem with a variable |
mojsa2000
Replies: 6
Views: 8726
|
Forum: General CCS C Discussion Posted: Sat Jul 23, 2011 2:59 pm Subject: problem with a variable |
Hi
this is a part of my code:
#include <16f877a.h>
#FUSES XT,NOWDT,PUT,BROWNOUT,NOLVP,HS
#device ADC=10
#use delay (clock=16000000)
#include <math.h>
#include <H:\P ... |
Topic: problem with a variable |
mojsa2000
Replies: 6
Views: 8726
|
Forum: General CCS C Discussion Posted: Sat Jul 23, 2011 1:50 pm Subject: problem with a variable |
Hi
I've maked a program that uses an Interrupt subroutine(AD_isr).
I defined a variable:
static int8 counter;
I want to increase this variable in my AD_isr when it occurs. But it doesn't work. ... |
Topic: PCM56p (DAC) problems |
mojsa2000
Replies: 5
Views: 8772
|
Forum: General CCS C Discussion Posted: Fri Jul 08, 2011 1:58 am Subject: SOLVED!!! |
Hi again
I tried on many ways but all of them were wasteful.
when I changed a command in device setup it worked.
the false command :
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_D ... |
Topic: PCM56p (DAC) problems |
mojsa2000
Replies: 5
Views: 8772
|
Forum: General CCS C Discussion Posted: Wed Jul 06, 2011 5:28 am Subject: PCM56p (DAC) problems |
Hi again
Help please...I can't get a valuable response from PCM56p. I tested any condition. I also checked all pins and wirings. I used the schematic that is mentioned in datasheet. (NOTE: ... |
Topic: PCM56p (DAC) problems |
mojsa2000
Replies: 5
Views: 8772
|
Forum: General CCS C Discussion Posted: Wed Jul 06, 2011 3:05 am Subject: PCM56p (DAC) problems |
Dear Ttelmah
thanks for your attention but I did what you siad and it didnt work.(output always is 0 volt)
by PCM56 datasheet it is necessary to make a delay(at least a cycle)
when LE(latch enable) ... |
Topic: PCM56p (DAC) problems |
mojsa2000
Replies: 5
Views: 8772
|
Forum: General CCS C Discussion Posted: Tue Jul 05, 2011 2:02 pm Subject: PCM56p (DAC) problems |
Hi
Did anybody work with PCM56p? I tried to use it and I couldn't get a true voltage on its output. I use a PIC16f877a with a SPI communication too.(crystal: 4 MHz).
I don't know what I do. This is ... |
|