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 79 matches
CCS Forum Index
Author Message
  Topic: How to fprintf in ISR?
haxan7

Replies: 10
Views: 24526

PostForum: General CCS C Discussion   Posted: Fri May 27, 2016 4:49 am   Subject: How to fprintf in ISR?
Even with interrupt based transmission I would still have to use a function like sprintf in the ISR.
  Topic: How to fprintf in ISR?
haxan7

Replies: 10
Views: 24526

PostForum: General CCS C Discussion   Posted: Fri May 27, 2016 4:29 am   Subject: How to fprintf in ISR?
There is a lot of stuff happening in the main loop, like talking to a modem, reading/writing to a flash memory etc. It does not always takes 1 second, but it happens often.
  Topic: How to fprintf in ISR?
haxan7

Replies: 10
Views: 24526

PostForum: General CCS C Discussion   Posted: Fri May 27, 2016 4:17 am   Subject: How to fprintf in ISR?
The ACK string is 10 characters, it includes a hex representation of a checksum. Currently I use "%02X" in the fprintf for string formatting and it works fine.


Also remember that interr ...
  Topic: How to fprintf in ISR?
haxan7

Replies: 10
Views: 24526

PostForum: General CCS C Discussion   Posted: Fri May 27, 2016 1:45 am   Subject: How to fprintf in ISR?
I am using a serial device that expects an "ACK" very very quickly.
Sending the "ACK" in the main loop is not an option, because the period of the main loop is larger than require ...
  Topic: Problems with large struct.
haxan7

Replies: 5
Views: 12187

PostForum: General CCS C Discussion   Posted: Tue Oct 13, 2015 11:43 am   Subject: Problems with large struct.
Spot on. Thanks a lot. My program definitely works now.
Apologies for any inconvenience caused by me by not posting a compilable program.
  Topic: Problems with large struct.
haxan7

Replies: 5
Views: 12187

PostForum: General CCS C Discussion   Posted: Tue Oct 13, 2015 9:34 am   Subject: Problems with large struct.
I think it is a compiler bug, I need help to go around it.
When I try to initialize the struct, the value assigned to a variable (any possibly others as well) is garbled up.

uController: PIC18F46K ...
  Topic: Are peripherals disabled by default?
haxan7

Replies: 11
Views: 17688

PostForum: General CCS C Discussion   Posted: Fri Oct 02, 2015 5:26 am   Subject: Are peripherals disabled by default?
Are all the peripherals turned off when you create a new project in CCS?
Or do I have explicitly turn off modules such as ADC, comparators, UART and PWM to cut down on power consumption?

Any poin ...
  Topic: CCS's Non-Standard Functions
haxan7

Replies: 3
Views: 8272

PostForum: General CCS C Discussion   Posted: Mon Jul 13, 2015 1:13 pm   Subject: CCS's Non-Standard Functions
Many of the standard C functions are implemented in a very non-standard way by CCS.
For example:
isspace() returns true for only ' ' and not for tabs and line feeds.
atoi does not skip the spaces i ...
  Topic: Dynamic Memory to implement Queues
haxan7

Replies: 5
Views: 9927

PostForum: General CCS C Discussion   Posted: Tue Jul 07, 2015 12:45 pm   Subject: Dynamic Memory to implement Queues
Thanks a lot for the responses.
I went ahead and implemented the queue using linked lists, but I went a step further and implement a generic queue.

This was my first time writing code with dynamic ...
  Topic: Dynamic Memory to implement Queues
haxan7

Replies: 5
Views: 9927

PostForum: General CCS C Discussion   Posted: Mon Jul 06, 2015 12:16 pm   Subject: Dynamic Memory to implement Queues
Would it be a good idea to implement a linked list based queue using malloc to maintain a queue of strings?
The char array would be 200 bytes each and size of queue would not increase beyond 5-6 node ...
  Topic: How to #define a Pre-Processor directive?
haxan7

Replies: 13
Views: 17246

PostForum: General CCS C Discussion   Posted: Sat Dec 27, 2014 11:10 am   Subject: How to #define a Pre-Processor directive?
I'm lost trying to understand what you're trying to accomplish. It's an easy task to setup 4 ISRs for the 4 hardware UARTs your PIC has(very,very few have 4 UARTs !).What PIC are you using??
Using t ...
  Topic: How to #define a Pre-Processor directive?
haxan7

Replies: 13
Views: 17246

PostForum: General CCS C Discussion   Posted: Sat Dec 27, 2014 10:32 am   Subject: How to #define a Pre-Processor directive?
You still have to change the interrupt enable as well.

Your approach seems pointless, since you are not adding buffering (just one character). Why not use the internal buffering?. Easier, and safer ...
  Topic: How to #define a Pre-Processor directive?
haxan7

Replies: 13
Views: 17246

PostForum: General CCS C Discussion   Posted: Sat Dec 27, 2014 9:46 am   Subject: How to #define a Pre-Processor directive?
Thanks for the replies.

I am doing it like following:

#if MY_DEVICE_STREAM==UART_PORT1
#define MY_DEVICE_RDA INT_RDA
#INT_RDA
#ELIF MY_DEVICE_STREAM==UART_PORT2
#define MY_DEVICE_RD ...
  Topic: How to #define a Pre-Processor directive?
haxan7

Replies: 13
Views: 17246

PostForum: General CCS C Discussion   Posted: Fri Dec 26, 2014 2:06 am   Subject: How to #define a Pre-Processor directive?
How to I #define a Pre-Processor directive? I want this so that I can easily move devices between UART Ports.

I want something like this:

#define device2ISR INT_RDA3


#device2ISR
void myISR ...
  Topic: struct with a constant member
haxan7

Replies: 3
Views: 10253

PostForum: General CCS C Discussion   Posted: Sat Nov 22, 2014 1:26 am   Subject: struct with a constant member
How do I declare a constant int in a struct.
I am trying to do the following, but its causing compilation error.

typedef struct{
const uint16_t baud;
char delimiter[5];
} ...
 
Page 1 of 6 Goto page 1, 2, 3, 4, 5, 6  Next
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group