Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16579
Available for Design & Build services
|
 |
« Reply #15 on: March 09, 2013, 02:58:36 am » |
Ack, 3AM! I'm off to bed. Will dig out my Sallea and look at the clocks & data tomorrow afternoon. G'night all!
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13897
Lua rocks!
|
 |
« Reply #16 on: March 09, 2013, 03:12:05 am » |
If I remove some NOPs won't it go even faster?
Yes, but the hardware won't have finished clocking out the byte. So you will lose data.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 120
Posts: 10201
|
 |
« Reply #17 on: March 09, 2013, 03:18:16 am » |
Yes, IE9 That thing causes me fits as well. Turning "Compatibility Mode" on seems to help. The odd thing is I only have trouble with Internet Explorer on this forum. I suggest using Firefox. G'night all! Back at ya! I'm headed there as well...
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16579
Available for Design & Build services
|
 |
« Reply #18 on: March 09, 2013, 03:25:41 pm » |
Okay, I got some results that look good. Used the unlooped asm version of SPI with more NOPs added, see attached. Took 15 to get reliable results. Started with 7, added 7, added 7, then started backing down. Can't see itin the double digits, but the data does go from 0 to 40 as expected. 46uS for a burst, and 58uS burst to burst. Gives me plenty of time to set up the data in the input registers and wait for an interrupt to occur to pop it to the output registers Thanks for the help Nick.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16579
Available for Design & Build services
|
 |
« Reply #19 on: March 09, 2013, 03:28:27 pm » |
This was my first time using my Saleae 8-channel analyzer, was easy to set up the software and run it. http://www.saleae.com/downloads
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13897
Lua rocks!
|
 |
« Reply #20 on: March 09, 2013, 03:42:25 pm » |
Yep, that's how I debugged it.
As I said earlier, you don't need to drop into assembler, because: first, the generated C code is pretty good, and second, you are adding NOPs anyway.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16579
Available for Design & Build services
|
 |
« Reply #21 on: March 09, 2013, 06:06:04 pm » |
Where am I dropping into assembler? I followed the example you provided a few replies ago. If there's something I can leave out let me know.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13897
Lua rocks!
|
 |
« Reply #22 on: March 09, 2013, 07:18:09 pm » |
You said: Used the unlooped asm version of SPI ... However if you used my loop with the NOPs that should be fine.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16579
Available for Design & Build services
|
 |
« Reply #23 on: March 09, 2013, 07:48:31 pm » |
That's what I've done:
SPDR = (testArray[fakestartPoint + 0]);nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;nop; nop; nop;nop; nop;
41 times, takes 46uS.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13897
Lua rocks!
|
 |
« Reply #24 on: March 09, 2013, 07:55:58 pm » |
To save a lot of repetition you should be able to do this: SPDR = testArray [0]; for (x = 1; x < 41; x++) { nop; nop; nop; nop; nop; nop; nop; SPDR = testArray [x]; }
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
There are less NOPs because the loop takes a bit of time to execute.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16579
Available for Design & Build services
|
 |
« Reply #25 on: March 09, 2013, 08:44:49 pm » |
Thanks. What I have is written, & tested, all set up for 324 rows. Gonna use a 1284 for a big SRAM array (41 bytes x 324 rows) that users can change, so code space will not be an issue.
|
|
|
|
|
Logged
|
|
|
|
|
|