SSP in Master Mode (Interrupt Problems)

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

Re: SSP in Master Mode (Interrupt Problems)

Postby SLTom992 » Tue Jun 24, 2014 5:29 pm

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.
SLTom992
 
Posts: 58
Joined: Tue Jun 10, 2014 8:59 pm
PIC experience: Professional 1+ years with MCHP products

Re: SSP in Master Mode (Interrupt Problems)

Postby SLTom992 » Wed Jun 25, 2014 4:37 pm

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.
SLTom992
 
Posts: 58
Joined: Tue Jun 10, 2014 8:59 pm
PIC experience: Professional 1+ years with MCHP products

Re: SSP in Master Mode (Interrupt Problems)

Postby SLTom992 » Sun Jul 13, 2014 12:30 am

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.
SLTom992
 
Posts: 58
Joined: Tue Jun 10, 2014 8:59 pm
PIC experience: Professional 1+ years with MCHP products

Re: SSP in Master Mode (Interrupt Problems)

Postby ric » Sun Jul 13, 2014 12:58 am

Do you have a small example showing the number base problem?
I've never struck something like that.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Previous

Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 4 guests