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

ccs parameters

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
aaronik19



Joined: 25 Apr 2011
Posts: 297

View user's profile Send private message

ccs parameters
PostPosted: Wed Jan 09, 2013 2:45 pm     Reply with quote

I am in the middle of a project and now I want to add Timer0 Interrupts. In most cases I use the wizard at the beginning of the project to insert the features I would like to use. Is it possible to use the wizard to insert the Timer0 interrupts including the parameters associated to it?

Is there any interrupt I can use to send characters from PC to PIC (RS-232)?
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jan 09, 2013 3:10 pm     Reply with quote

1) I don't use the wizard...

2) You do not use an interrupt to send data from a PC to PIC (well you could but that's a PC issue), however from the PIC 'side' you can use an interrupt to receive data from a PC.
Have a look in the examples folder for a program called 'ex_sisr.c'

hth
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19510

View user's profile Send private message

PostPosted: Wed Jan 09, 2013 3:39 pm     Reply with quote

Actually you can use interrupts to send as well as receive. Much better in fact if you don't want code to have to wait for transmissions. INT_TBE. Look at ex_STISR.c (example serial transmit interrupt service routine).
Key is that you turn it on when data is waiting to be sent, and then turn it off again when data has been sent. Otherwise it'll stay permanently triggered if no more data is to be sent.

The wizard is quite dangerous, with several permanent errors (setup_spi for example), and often initialising things that already default to the same state (wasting space and time). 99% of long term programmers here prefer not to use it. Honestly better to use the standard settings from the examples, then build your own set, to do what you want.

Best Wishes
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Jan 09, 2013 6:04 pm     Reply with quote

Quote:

use interrupts to send as well as receive.


is true BUT if you are using a timer or other #int for a precise timing requirement,you should be aware that the USART send INT can preempt the timer and extend the period of the timer(or any other #INT ) on an intermittent basis that might be hard to debug-
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jan 09, 2013 6:45 pm     Reply with quote

His original question is really, "Can I use the CCS Wizard in mid-project,
to add a Timer0 interrupt function ? Can I add the function with the
Wizard, even though I've already typed in a lot of code ? Or, am I only
allowed to use the Wizard at the very start of a new program ?"

If someone has the CCS IDE, they could answer this question.
jeremiah



Joined: 20 Jul 2010
Posts: 1348

View user's profile Send private message

PostPosted: Wed Jan 09, 2013 8:03 pm     Reply with quote

I just tried it on a throwaway project of mine and it overwrote both the project file and my main c file. It doesn't appear to update but instead overwrites. That's not to say there's no way to do it, but just trying it offhand by opening an existing project didn't work well.
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Jan 09, 2013 11:07 pm     Reply with quote

Use the Wizard to create a dummy program then copy the code over.
_________________
Google and Forum Search are some of your best tools!!!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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