 |
 |
| View previous topic :: View next topic |
| Author |
Message |
BLL
Joined: 11 Nov 2006 Posts: 181 Location: Birmingham, UK
|
| fprintf etc |
Posted: Thu Jul 07, 2016 4:47 am |
|
|
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
|
|
Posted: Thu Jul 07, 2016 7:37 am |
|
|
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
|
|
Posted: Fri Jul 08, 2016 1:46 pm |
|
|
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 |
|
 |
|
|
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
|