Loading...
Pages: 1 [2]   Go Down
Author Topic: speed test  (Read 457 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 249
Posts: 16579
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ack, 3AM!
I'm off to bed. Will dig out my Sallea and look at the clocks & data tomorrow afternoon.
G'night all!
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 219
Posts: 13897
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Online
Shannon Member
*****
Karma: 120
Posts: 10201
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 

Quote
G'night all!

Back at ya!  I'm headed there as well...
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 249
Posts: 16579
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 249
Posts: 16579
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 219
Posts: 13897
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Brattain Member
*****
Karma: 249
Posts: 16579
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 219
Posts: 13897
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You said:

Quote
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 Offline
Brattain Member
*****
Karma: 249
Posts: 16579
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 219
Posts: 13897
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

To save a lot of repetition you should be able to do this:

Code:
    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 Offline
Brattain Member
*****
Karma: 249
Posts: 16579
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Pages: 1 [2]   Go Up
Print
 
Jump to: