I give up - Need Help
Rubberduck
Posts: 11
Hello Forum
I need some help with the posted files. I try to explain my problem.·In the "Main",·I start a reading·of a·MCP3208 AD. "child" reads all 8 channels and store them. Then it should put the results back in a array in "main". The result of 5 channels is "transmitted" as it should. But 3 is not. And I can't figure out why. Just to test I write "123"·rather then·the·real value from AD.
I'am looking for speed in my application so if anyone find something that could be improved please let me know (probably a bunch of stuff .
Thanks
Andreas
I need some help with the posted files. I try to explain my problem.·In the "Main",·I start a reading·of a·MCP3208 AD. "child" reads all 8 channels and store them. Then it should put the results back in a array in "main". The result of 5 channels is "transmitted" as it should. But 3 is not. And I can't figure out why. Just to test I write "123"·rather then·the·real value from AD.
I'am looking for speed in my application so if anyone find something that could be improved please let me know (probably a bunch of stuff .
Thanks
Andreas
Comments
You wanted
adc RES 8
I presume?
That solved the problem. Why did it work for the first·and 5-8th channel?
But my idea was to store the values in 8 words. And then "transfer" 4 longs·to save some instr (I know that I'm not "transfering" longs at the moment but I want to in the future). Does that make sense? Is it possible?
word 1-
word 2 - long 1
word 3 -
word 4 - long 2
word 5 -
word 6 - long 3
word 7 -
word 8 - long 4
/andreas
With words you can transfer 8 of them in:
8*16 ticks =1.6 µs = 600 kHz
This delays the sampling.. I have not counted what the sampling part takes..
But there is little chance you can do ANYTHING at all in SPIN at this fast pace...
Post Edited (deSilva) : 1/11/2008 12:37:24 AM GMT
http://forums.parallax.com/forums/default.aspx?f=25&m=168330
Again, it is not a general purpose spi, But maybe it will give you an idea or two!
I see you modified my assembly code from the object exchange (MCP3208_fast).
Enjoy!
Jim
The program I posted is not all of it - it doesn't show what I really want to do. My goal is to fill a buffer (512 bytes) in child. And then in spin write that buffer to a SD-card. While the Main is writing the first buffer, child will fill a second buffer of 512 bytes. As you all have figured out I'am new to the propeller - but could this be a good way to do it? Or is there an better way to do that?
bambino:
Maybe I'am wrong but I don't think the AD can handle more speed. But maybe I can use it for the SD-card to speed things up...
Jim:
Yes, a big thanks - the object exchange is a life saver! Hopefully I can contribute in the future [noparse]:)[/noparse]
Thanks to You all for your ideas and your time
/Andreas
But it needs that you exactly count and calculate the time needed for all steps...
You said you think the A/D can handle more speed. The code that you're using (MCP3208_fast) has been tuned to sample the MCP3208 at the fastest speed allowed by the chip specifications.
You can increase the adc sample speed by over-clocking it. I've experimented with this and the chip seems to handle a faster speed without a problem. However, I didn't want to release something to the object exchange that operated outside of the chip specs.
Let me know if you need more help with this.
Jim
Okej - I continue with the work and when I have a working program - I hopefully will be able to see where I have the bottlenecks.
Jim:
Actually I didn't think the AD could handle more speed. And as for the code MCP3208_fast I didn't that could be improved either (take that as a compliment). But that sounds great - I never thought about overclocking the AD. But as for now I need to get the rest of the code working as I want. And later on I may hold you to your word [noparse]:D[/noparse].
How much did you overclock the AD?
Thx
Andreas