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

Compiler Bug or Do I Need to Get Myself a Good C Book
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Oct 27, 2019 1:58 pm     Reply with quote

I would like to know how he is displaying the result. Is he using printf ?
Or a watch window with the ICD debugger ? Details on this are needed.
matthewsachs



Joined: 19 Jun 2016
Posts: 22

View user's profile Send private message

PostPosted: Sun Oct 27, 2019 5:21 pm     Reply with quote

PCM programmer wrote:
I would like to know how he is displaying the result. Is he using printf ?
Or a watch window with the ICD debugger ? Details on this are needed.


The board I am working on has an FTDI device so I do this

Code:


int16 FLOW_A_SCALE_FACTOR = 7371L;
int16 ANA_FLOW = 0L;
int16 ANA_ADC = 0L;

void main()
{
     while(TRUE)
    {
        set_adc_channel(1);
        delay_us(10);
        ANA_ADC = read_adc();
        delay_us(10);

        ANA_FLOW = ADCtoFLOW(ANA_ADC, FLOW_A_SCALE_FACTOR);

        printf(usb_forward,"Analog A RAW ADC: %lu \r\n", ANA_ADC);
        printf(usb_forward,"Analog A FLOW_A_SCALE_FACTOR: %lu \r\n", FLOW_A_SCALE_FACTOR);
        printf(usb_forward,"Analog A Flow Reading: %lu \r\n", ANA_FLOW);
        delay_ms(500);
    }
}

Ttelmah



Joined: 11 Mar 2010
Posts: 19587

View user's profile Send private message

PostPosted: Sun Oct 27, 2019 11:27 pm     Reply with quote

Show the whole code. The processor header, includes etc..
Corruption, doesn't have to be random, it can simply be something
writing over something else. Hence the whole environment matters.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group