Go to Post So measure not by the masses, but by the sparks that you generate. - Kims Robot [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 14-12-2003, 20:00
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Problem with interrupts on the PIC

I wrote a quadrature decoder for the PORTB change state interrupt pins (RB4-7, or IFI 3-6). It is simple and works great. Just enable the RB interrupt, assign it to low priority and enable global interrups and it works. I call my routine from the user_function_fast.c module in the low interrupt handler.

However. The system doesn't work. As my shaft turns and the counts are accumulated the servo output pulses glitch and the serial I/O over the program port glitches. If I run my encoder fast enough the entire system crashes.

Attached is the code.

I have done a lot of embedded small system programming and I know what I am doing, however, this is my first time with a PIC, so there could be something I don't understand. But looking at the dissasembly code it all looks ok. Interrupts off upon entry, re-enabled upon exit, call a single routine.

Any ideas? It sure looks like a classic race condition where something is crapping on something else. Maybe this is a C compiler thing?
Attached Files
File Type: zip Quadrature.zip (1.4 KB, 154 views)

Last edited by Larry Barello : 15-12-2003 at 13:14. Reason: Updated zip file per Mike's suggestions.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Victor problem Andy Baker Electrical 15 24-06-2003 09:49
Ok one problem cantwell03 Programming 3 13-02-2003 07:28
The problem with scouting... archiver 2001 10 23-06-2002 23:49
Major problem with chipphua motors aka Scott White Motors 18 19-03-2002 19:44


All times are GMT -5. The time now is 10:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi