Page 2 of 2

Re: SSP in Master Mode (Interrupt Problems)

PostPosted: Tue Jun 24, 2014 5:29 pm
by SLTom992
I have reduced the entire program to only the SSP portion and am presently working on it. There is obviously some logical error that I must find since the problem remains. I'll get back to you.

Re: SSP in Master Mode (Interrupt Problems)

PostPosted: Wed Jun 25, 2014 4:37 pm
by SLTom992
OK, I have learned/remembered a lot in these exchanges, The basic problem was that I didn't analyze the hardware itself and went off on the tangent. The true problem was that somehow I got the idea that this was an SPI interrupt problem when in fact it was a missing external interrupt problem.

The SPI was working as it should have been and was trapped in a loop since it wasn't mediated by the external interrupt.

Also I downloaded a more up-to-date manual which noted that ALL interrupt flags are set regardless of the enable bit for that specific interrupt so that when receiving an interrupt you must be careful to specifically look at the flag bits you are interested in.

I'd like to thank those who have been so helpful if a bit confused at what I was trying to say. Part of the moral to this string is to not get a concussion; they are a lot more serious than you might think.

Re: SSP in Master Mode (Interrupt Problems)

PostPosted: Sun Jul 13, 2014 12:30 am
by SLTom992
Sorry I haven't been back to you. I have a 4 MHz external crystal but my interrupts were going to be every 250 usec. That turned out to be too fast so I changed it to a millisec. Most of my problems turned out to be things having to do with the compiler for the most part. The compiler makes errors converting from one number base to the other and from what base to what base and in what order seems to be the problem. It will convert fine in one order and make the slightest change and the conversion messes up. So when you're writing code you have to have a debugger such as an ICD3 so that you can look at the results in the registers themselves.

The major problem with the SPI had to do with the ANSEL which wasn't being set since I had assumed that it defaulted to Digital inputs and not Analog.

Re: SSP in Master Mode (Interrupt Problems)

PostPosted: Sun Jul 13, 2014 12:58 am
by ric
Do you have a small example showing the number base problem?
I've never struck something like that.