Intense SPI = no ISP

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello freaks!
I'm playing with a mega16 on an STK500. I have a Nokia 3310 LCD connected to the SPI.
I wrote a small loop to get an impression of the speed of this display, something like this:

for(;;) {
   write_all_ones();
   write_all_zeros();
}

This loop occupies the SPI near 100%. The write functions have checking for ongoing transitions.

Now the fun part:
I can't connect to the STK500 while the program is running.
If I hold the reset button on the STK500, then the "connect" dialog opens as normal.
Why is this happening? I would think the STK500 subsystem should be able to communicate with the PC even with SPI traffic on the target.
Looks like it's not possible to adjust any voltages or frequencies with SPI activity on the target. Strange.

More fun:
If I hold the reset button, open the "connect" dialog and release the reset button, I can't reprogram the target. Or read fuses or anything.
If I hold the reset button, all comes back.
That's strange. I thought ISP has control over the reset line of the target.

Is this also applicable to "real-world" (off STK500) systems?

Any thoughts or experiences are welcome.

BTW: the lcd is very fast. Easy to use too. :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1.
If you post code, then you should post the real code, which can be compiled without errors.

Now anybody can only see, that you call a subroutine, but never, what happens inside this subroutine.

So nobody can understand, what your program do.

2.
A display should be updated no faster than 2..5 times per second, because the main task of a display is, the human must be able to read it !

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know anything about STK500, but the symptoms are that something is hogging on your reset line and ISP interface on the board is too weak to pull it down fully. When you press the button, I guess it is equivalent of short-circuiting RESET to ground, and the controller enters RESET mode despite of all woes.

Is this really because of SPI being busy, hardly so?

The Dark Boxes are coming.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All is back to normal now, don't know what was wrong.

I loaded some other program into the mega16 and it worked fine.
Back to the LCD test, locked.

Did this several time with the same result until it suddenly started working normally.

Quote:
...something is hogging on your reset line...

Totally agree with you svofski. This could not have been a software issue.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you connect SPI slaves on the same wires, which are used for programming, then you must connect a pull up resistor on every /SS pin to disable the slave.

Otherwise the slave may have activated its MISO pin and thus programming must fail.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

danni: thank you! I'm designing a board with 2 SPI slaves and your statement came just in time..

The Dark Boxes are coming.