ERMEGM
- 6th June 2014, 16:17
This thread has split into two parts, but it still covers being able to do two things at once. To better explain my first question, if I made two boards, each controlling an LED and made one single flash at 1 Hz and the other quadruple flash at 2 Hz, then the LEDs would go in and out of phase with each other. My first question was how do I implement this into one chip where you can change the pulse count and speed of one output and have another output doing something else concurrently? I know it can be done because I have seen it on other products.
Mind you on one of these products, the output that is doing single flash is also part of a trigger, so that when the trigger impulse is received, the pattern changes. I'm thinking an interrupt routine, but can that routine cause an output or two to pulse while the chip is doing something else?
Another method was using shift registers, but I found another circuit that did not.
The MIBAM I am familiar with. I haven't played with it yet, but can it do these effects, or do the LEDs just fade to 0? Here is a better representation of the effects.
http://www.youtube.com/watch?v=28odSOh-Aog#t=25
He provides the code for his chips here (http://picprojects.org.uk/projects/480/pro481/index.htm#Firmware), and explains how to assemble them in MPLAB, but is there any way to implement those functions in PBP? Obviously the code doesn't transfer into PBP as it does not recognize it. I know it's written for MPASM, but can PBP code not do anything like this?
A short example of the patterns he's written:
; ----------------------------------
; See pwmc_SeqMacro.inc for information on the format of the sequence data
;
; ----------------------------------
; seq 01
control 0,4
hold 8
sdat 3,0,0,0,0,0,0,0
hold 8
sdat 2,3,0,0,0,0,0,0
hold 8
sdat 1,2,3,0,0,0,0,0
hold 8
sdat 1,1,2,3,0,0,0,0
hold 8
sdat 0,1,1,2,3,0,0,0
hold 8
sdat 0,0,1,1,2,3,0,0
hold 8
sdat 0,0,0,1,1,2,3,0
hold 8
sdat 0,0,0,0,1,1,2,3
hold 8
sdat 0,0,0,0,0,0,1,3
hold 8
sdat 0,0,0,0,0,0,0,3
hold 8
sdat 0,0,0,0,0,0,3,2
hold 8
sdat 0,0,0,0,0,3,2,1
hold 8
sdat 0,0,0,0,3,2,1,1
hold 8
sdat 0,0,0,3,2,1,1,0
hold 8
sdat 0,0,3,2,1,1,0,0
hold 8
sdat 0,3,2,1,1,0,0,0
hold 8
sdat 3,2,1,1,0,0,0,0
hold 8
sdat 3,1,0,0,0,0,0,0
seqend
; ----------------------------------
; seq 02
control 0,4
hold 11
sdat 3,0,0,0,0,0,0,0
hold 11
sdat 2,3,0,0,0,0,0,0
hold 11
sdat 1,2,3,0,0,0,0,0
hold 11
sdat 1,1,2,3,0,0,0,0
hold 11
sdat 0,1,1,2,3,0,0,0
hold 11
sdat 0,0,1,1,2,3,0,0
hold 11
sdat 0,0,0,1,1,2,3,0
hold 11
sdat 0,0,0,0,1,1,2,3
hold 11
sdat 0,0,0,0,0,0,1,3
hold 11
sdat 0,0,0,0,0,0,0,3
hold 11
sdat 0,0,0,0,0,0,3,2
hold 11
sdat 0,0,0,0,0,3,2,1
hold 11
sdat 0,0,0,0,3,2,1,1
hold 11
sdat 0,0,0,3,2,1,1,0
hold 11
sdat 0,0,3,2,1,1,0,0
hold 11
sdat 0,3,2,1,1,0,0,0
hold 11
sdat 3,2,1,1,0,0,0,0
hold 11
sdat 3,1,0,0,0,0,0,0
seqend
; ----------------------------------
It's simpler to just write what the LED's intensity should be at said position. Maybe MIBAM can do this, but do any modifications have to be made to the MIBAM code?
I was wondering if PBP code could be written in a way to implement "some" of these features. I would like the ability to write 0 through whatever limit to specify LED intensity instead of pwm. Also, this way, you can pwm more than one output.
I know DT's MIBAM can do some of those effects, but I was wondering how to implement features as being able to write "sdat 0,1,1,2,3,0,0,0" to control pwm of the outputs.
I have written other types of flashing sequences and would like to implement some other patterns like these. Any way of utilizing some of the code and not all of it?
Thanks,
Tony
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.