electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming today at radio.electro-music.com

  dRachEmUsiK Music from last Thursday
Please visit the chat
 Forum index » DIY Hardware and Software
PIC Sequencer software step rate?
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [2 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
dugernaut



Joined: Jul 24, 2009
Posts: 41
Location: New Jersey

PostPosted: Mon Aug 16, 2010 9:41 am    Post subject: PIC Sequencer software step rate? Reply with quote  Mark this post and the followings unread

I've written a fairly basic 16 step sequencer for the PIC cpu, but I've been trying to use the internal timer controlled by the ADC as a clock source.

It works, but the linearity (or my perception of linearity) sucks. When I increase the input to the ADC with a linear pot, I use that value to adjust the load into the timer. If I look at the output LEDs of the ADC (on my development board) they seem to be roughly doing what I'd expect.

The result is that very little happens at the low (slow) end, but as I move the input up, the speed slope happens way too fast. It's like a two cascaded expo generators controlling a VCO.

Maybe I'm thinking about this all wrong, but I've spent hours on this. Any help would be greatly appreciated.
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 16134
Location: Netherlands, Enschede
Audio files: 75
G2 patch files: 307

PostPosted: Mon Aug 16, 2010 12:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

How to do it depends a bit on what timer you use in exactly what PIC ...

Keep in mind that timers count up for the PIC until they overflow which then generates the interrupt ... so you'll want to subtract the value from zero (or 65536).

Unless you use an 8 bit timer with a preset register, in which case you can put the value into that one to determine the period. Such a timer will count up from zero until the PR register value is hit, at which time it will generate an interrupt.

Another thing is that probably you do not want to linearly change the timer period, but its frequency rather - which is inversely proportional, meaning you'll want to put in 1 divided by the AD value. (or maybe 1024 divided by ... or whatever scaling turns out to work best).

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [2 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software
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
You cannot attach files in this forum
You can download files in this forum
Niio2

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use