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

sprintf/fprintf behaviour
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BLL



Joined: 11 Nov 2006
Posts: 181
Location: Birmingham, UK

View user's profile Send private message

fprintf etc
PostPosted: Thu Jul 07, 2016 4:47 am     Reply with quote

Hi, I did use a scope on there to get the amplitude and the pulses were fine.
Since my last post, it suddenly put itself right. I can only presume it was a bad connection on the prototype board. I wiggled everything afterwards but it is still fine, so I am not sure!
The main thing is that it's counting the pulses from DO correctly.
Thanks all for your help.
Brian
Ttelmah



Joined: 11 Mar 2010
Posts: 20061

View user's profile Send private message

PostPosted: Thu Jul 07, 2016 7:37 am     Reply with quote

The key point is that the hardware will count what is there....

It may well be that the same bad connection was the core of your trouble. The point is that the pulse interrupt you were using, introduces about a 60 instruction 'overhead' every time it is called. If it only happened once in a single character (as it should), then your serial should still be acceptable. However happen more often than this, and the result will be garbage, which is what you were seeing.
BLL



Joined: 11 Nov 2006
Posts: 181
Location: Birmingham, UK

View user's profile Send private message

PostPosted: Fri Jul 08, 2016 1:46 pm     Reply with quote

You are probably right - I don't like prototype boards as I have had trouble before with them, but short of wasting a number of pcbs, one doesn't have much choice.
The timer1 method is much preferable to my interrupt method, but as said before, I didn't know you could do that, but I do now!
Thanks again for your help.

Regards

Brian
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, 3, 4
Page 4 of 4

 
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