Go to Post What else could you do with a t-shirt? Wait... never mind... I retract my previous statement and realized this is FIRST and we can do anything with anything. ;) - Jeremiah Johnson [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
  #1   Spotlight this post!  
Unread 02-12-2003, 02:01
JimWright949's Avatar
JimWright949 JimWright949 is offline
The Owen Day of Seattle
AKA: Jim Wright
FRC #4542 (Titanium Talons)
Team Role: Mentor
 
Join Date: Sep 2003
Rookie Year: 2003
Location: Redmond, WA
Posts: 94
JimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to behold
Hints for the Edu Interrupts

Hello all,

Since I'm a mentor I will not give you the answer as to how to get your interrupts running. However here is some usefull information:

1) In the Microchip library there is a function called OpenPORTB, find out what is does and put it in your initialization code.

2) When you are calling interrupts you need to "save the context", there is a note about this in the PIC18F8520 datasheet on the Microchip site. However this is for people writing assembler, and the C code will not need this.

3) You may not want to code a printf line into an interrupt. It is generally a bad idea in the embedded programming world. To test if the interrupt is working have it add 1 to a global variable. Put this line in your main.c outside the main function (line 23):
int global_counter;

Put the printf in the main:
printf("Counter=%d\n",global_counter);

Put this line in your user_routines_fast.c outside any functions (line 60):
extern int global_counter;

Put this code in the InterruptHandlerLow () function:
global_counter++;

When you run your program and close and open the Interrupts the count will increase.

-Jim Wright
 


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
My hints and guess on the Game in 2004! Elgin Clock Rumor Mill 116 09-01-2004 13:30
Problem with interrupts on the PIC Mike Betts Programming 7 16-12-2003 21:26
Interrupts on the EDU-RC? Andrew Programming 3 13-11-2003 23:16
Hints For Rookie Programmers Noah Programming 30 20-02-2003 20:07
Hints @ Kickoff Broadcast Nate Smith General Forum 13 05-01-2002 10:14


All times are GMT -5. The time now is 00:34.

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