SPI onBoard Network problem...please help

Peter KWS
Benutzer
Avatar
Gender: n/a
Age: 41
Posts: 18
Registered: 11 / 2011
Subject:

SPI onBoard Network problem...please help

 · 
Posted: 18.04.2013 - 09:26  ·  #1
Hi all, i have little proble with SPI onBoard NETWORK. my program (master and slave) is examle from elab(spimaster,spislave), all work fine! When i enable ext. interrupt an int0 pin in slave CPU, sometimes SPI report error and lost byte on LCD. It is possible use SPI and ext. int and timcompa interrupt one CPU at a time? slave CPU is mega8 and master mega16, i build Inductive load triac regulator with master(LCD,Analog,SPI,Buttons) and 4x slaves(Zerro cross, Triac drive,SPI) for outputs. thanks for answer, have nice day :) (srry for my english)
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1408
Registered: 03 / 2005
Subject:

Re: SPI onBoard Network problem...please help

 · 
Posted: 18.04.2013 - 17:03  ·  #2
Hi Peter.

How much work do you do in your interrupt?

When you enter an interrupt all interrupts are disabled until the end of the routine.

Also with SPI you must remember that the slave MUST keep up with the master. The master generates the clock and the slave must keep up with it. My guess is that when you enable the interrupt the slave simply cannot keep up with the master. You could try slowing the master down, and try to keep the contents of the interrupt down to a bare minimum, maybe just a flag to tell the main program that it must act.
Peter KWS
Benutzer
Avatar
Gender: n/a
Age: 41
Posts: 18
Registered: 11 / 2011
Subject:

Re: SPI onBoard Network problem...please help

 · 
Posted: 29.04.2013 - 09:06  ·  #3
Ok, thank you for answer :) Have nice day :)
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   65   79 · Page-Gen-Time: 0.105871s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI