Skip to search.
basicx · Discussion list for the BasicX family of microcontroller chips

Group Information

  • Members: 1881
  • Category: Microcontrollers
  • Founded: Aug 11, 1999
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

  Messages Help
Advanced
Alternating Rising and Falling Edge Interrupts   Message List  
Reply Message #18510 of 23496 |
Re: Alternating Rising and Falling Edge Interrupts


--- In basicx@yahoogroups.com, "Tom Becker" <gtbecker@r...> wrote:
> Great! Then some convenient functions to control these things
> would be valuable additions to the tools. Can they be written?

Sub AbortTask(taskStack() as Byte)
taskStack(1) = bxExitTask
End Sub

Sub AwakenTask(taskStack() as Byte)
Dim wasLocked as Boolean
wasLocked = TaskIsLocked()
If (Not wasLocked) Then
Call LockTask()
End If
If (taskStack(1) = bxTaskSleeping) Then
taskStack(1) = bxTaskRunning
End If
If (Not wasLocked) Then
Call UnlockTask()
End If
End Sub


Sub SleepTask(taskStack() as Byte, ByVal sleepTime as Integer)
Dim wasLocked as Boolean
wasLocked = TaskIsLocked()
If (Not wasLocked) Then
Call LockTask()
End If
taskStack(1) = bxTaskSleeping
Call BlockMove(2, MemAddress(sleepTime), MemAddress(taskStack(2)))
If (Not wasLocked) Then
Call UnlockTask()
End If
End Sub

The first two are untested but should work as advertised.
The SleepTask() subroutine appears to work but it may not work
reliably due to the issues that I pointed out in my previous message.

Don







Wed Apr 13, 2005 4:28 pm

don_kinzer
Offline Offline
Send Email Send Email

Message #18510 of 23496 |
Expand Messages Author Sort by Date

Has anyone implemented interrupts on both edges by alternating WaitForInterrupt(bxPinRisingEdge) and WaitForInterrupt(bxPinFallingEdge)? Tom Tom Becker --......
Tom Becker
b19063 Online Now Send Email
Apr 11, 2005
5:18 pm

I have been thinking about something like that. I have been progressing with my little (in importance, not in code size or effort) rally computer. I off...
arhodes19044 Offline Send Email Apr 11, 2005
6:08 pm

On a little more research: Register.MCUCR, which determines the interrupt type (Rising, Falling, Low and that always intriguing Reserved) retains Rising mode...
Tom Becker
b19063 Online Now Send Email
Apr 11, 2005
7:01 pm

Hmm it does sound like a bug in the setting function. I also find these "reserved" functions intriguing too. The questions of why they did it, and what they...
arhodes19044 Offline Send Email Apr 11, 2005
7:41 pm

... Register.MCUCR=8... Another method that preserves the other bits in MCUCR is to precede WaitForInterrupt() with Register.MCUCR = Register.MCUCR And...
Tom Becker
b19063 Online Now Send Email
Apr 11, 2005
11:48 pm

... Were your experiments done on the BX-24 or BX-24p? The Mega8535 has a "level change" mode in addition to the rising edge, falling edge and low level. It...
Don Kinzer
don_kinzer Offline Send Email
Apr 12, 2005
2:33 am

... On both BX-24 and BX-24p, the mode bits need to be cleared before WaitForInterrupt() can set them to Falling Edge. They appear to be cleared at Reset, so...
Tom Becker
b19063 Online Now Send Email
Apr 12, 2005
2:54 am

I'm just a novice on these subjects but this discussion interests me as it could solve my problem: having procedure1 working when a certain pin is high and...
David Sousa Mendes
davidsousamendes@... Send Email
Apr 12, 2005
8:00 pm

... Yes, interrupts to the BX-24 must be on its pin 11; normally, the pin must be configured as Input or Pullup, depending on the interrupt source [although...
Tom Becker
b19063 Online Now Send Email
Apr 12, 2005
8:52 pm

Tom, 1 - You say pin 11 can be configured to either input or pullup but I can't find no input configuration... The manual says: "Allowable values for State:...
David Sousa Mendes
davidsousamendes@... Send Email
Apr 13, 2005
12:29 am

... You can configure the I/O pin states in the BX-24 IDE Project pulldown menu; see Chip. You can also configure the pins by using PutPin(). What I and the...
Tom Becker
b19063 Online Now Send Email
Apr 13, 2005
12:16 pm

... Au contraire, mon ami. The first byte of the task frame (the first 15 bytes of the task stack) seems to be a combined status/command byte. Although not...
Don Kinzer
don_kinzer Offline Send Email
Apr 13, 2005
3:35 pm

... Great! Then some convenient functions to control these things would be valuable additions to the tools. Can they be written? Tom Tom Becker --... ...-- ...
Tom Becker
b19063 Online Now Send Email
Apr 13, 2005
3:37 pm

... Sub AbortTask(taskStack() as Byte) taskStack(1) = bxExitTask End Sub Sub AwakenTask(taskStack() as Byte) Dim wasLocked as Boolean wasLocked =...
Don Kinzer
don_kinzer Offline Send Email
Apr 13, 2005
4:30 pm

oi David Para saires de um procedimento tens de fazer a verificação de uma condição que a um dado momento tem de ser falsa por exemplo quando o pin11 for...
Marco Dutra
marcodutra33 Offline Send Email
Apr 13, 2005
11:33 am

... Yes, it does... I opted for verifying the state of DTR in each procedure... After all, most of the time, the procedure Log_Data is sleeping, waiting for...
David Sousa Mendes
davidsousamendes@... Send Email
Apr 13, 2005
2:03 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help