05-25-2009, 11:46 PM
|
#1421 (permalink)
|
EcoModding Lurker
Join Date: Apr 2009
Location: Maine
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
|
That sounds right to me, if after "after" the comparator, then it should be isolated by the comparator and not be able to affect the signal at your current transducer.
I am no expert on this though; I am going to have plenty of questions of my own as I attempt my own controller. I am hoping that maybe you can stop by and help me with a few questions once I start a thread for it.
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
05-25-2009, 11:50 PM
|
#1422 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
Oh heck ya! I'd love to help in any way I can!
|
|
|
05-25-2009, 11:52 PM
|
#1423 (permalink)
|
EcoModding Lurker
Join Date: Apr 2009
Location: Maine
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
|
open source ROCKS!
|
|
|
05-25-2009, 11:54 PM
|
#1424 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
Heck yes it does...
I got the edit! Thanks, DCB!!!!
|
|
|
05-25-2009, 11:56 PM
|
#1425 (permalink)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
oops, you have to set the right channel in the timer ISR, not the adcComplete isr. Made tweaks to timer and adc isr in the outline above.
EDIT: and I should have said reti, not iret, though I'm not %100 on how you get there from C, so just skip the block I recon.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
Last edited by dcb; 05-26-2009 at 12:18 AM..
|
|
|
05-26-2009, 12:27 AM
|
#1426 (permalink)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
ok, that timer1 function takes 49 cycles (3.062us @ 16mhz)
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
|
|
|
05-26-2009, 12:29 AM
|
#1427 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
Holy hanna montana that's fast! Almost as fast as my 45 microseconds... Wait... nevermind.
Hey, I finished entering the directions for etching the power section just now. It's in Open Office Spreadsheet. I got to get me some emails to send it to! Note: I haven't done the drilling coordinates yet. This file only has the etching directions for one of the versions. I wanted to try 2 versions, just to see which one blows up faster. hahaha! Just kidding you guys (about the blowing up, not the 2 versions).
Last edited by MPaulHolmes; 05-26-2009 at 12:35 AM..
|
|
|
05-26-2009, 12:46 AM
|
#1428 (permalink)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
Quote:
Originally Posted by MPaulHolmes
Holy hanna montana that's fast!
|
Well, it is just scheduling the adc conversions and returning. The adc conversions happen in the hardware and the main loop will march forward till the adc complete interrupt says ("OK, I read that last channel").
The top of the main loop halts interrupts briefly, makes its own copies of the interesting variables, then re-enables interrupts. It can't use the global versions directly because they could get updated in the middle of a computation.
Max ADC rate is about 10khz, and there is only one channel at a time, so a lot of the timer1 calls will auto-return, but it is what it is and the bulk of the processing (32 bit math?) can happen in the main loop outside of interrupts.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
|
|
|
05-26-2009, 01:38 AM
|
#1429 (permalink)
|
EcoModding Lurker
Join Date: Aug 2008
Location: Calgary, AB
Posts: 21
Thanks: 1
Thanked 1 Time in 1 Post
|
dcb,
I really like your code for the ISR's.
It looks like Paul has the ADC clock at 1MHz (which means he should only use 8 bits of the result). Other than the first result the ADC takes 13 ADC cycles, or about 13us. So we can read the current for every ISR with plenty of time for everything else.
|
|
|
05-26-2009, 06:37 AM
|
#1430 (permalink)
|
EcoModding Lurker
Join Date: May 2009
Location: Bucharest,RO and Copenhagen,DK
Posts: 42
Thanks: 0
Thanked 1 Time in 1 Post
|
Quote:
Originally Posted by dcb
...
Max ADC rate is about 10khz, and there is only one channel at a time, so a lot of the timer1 calls will auto-return, but it is what it is and the bulk of the processing (32 bit math?) can happen in the main loop outside of interrupts.
...
|
The is smth. I do not understand here ... ADC will take 13 ADC clocks, we have a 1MHz clock for adc (we loose some precision, 2.5lsb out of 10bit if i'm not mistaken) that means 77kHz max. ADC rate! There will never be be an "auto-return" of the timer1 ISR at 16khz on the grounds of unfinished conversion if we only convert 1 channel at a time...
What am I missing?
L.E.: Doh! Next time i will scroll down before replying ...dlaing had the same observation 5 hours before me
Last edited by charlie_fd; 05-26-2009 at 06:41 AM..
Reason: have seen the last reply :)
|
|
|
|