
protofuse
Programmer-
Posts
288 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Blogs
Gallery
Everything posted by protofuse
-
hello TK I forgot to write: I think about a code problem. indeed, there aren't randomly events it happens everytime I push or release a button. I rechecked my SR connections (I'm using smashTV modules core, din, ain and dout) all is ok. but my midibox send this flow of message everytime I push a button. I have to say I display "last pin pressed" on my LCD... the right number is displayed. and the right note on value is correctly sent. I think about a midi interface issue or a code issue :-( I attached the code I'm actually using for testing purpose. main.c main.h main.c main.h
-
wow. I guess one day, I'll make an evolution of my protodeck controller and I'll use a STM32! indeed, today, I have 2 cores for 3 DINx4, 3 AINx4, 2 DOUTx4 with the STM32, I guess I'd have only one STM32 with all of that... and USB and and and :P
-
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
now,I could explain how to build and drive that ;) special thanks to lucem, wickedblade, TK ... noofny of course, and the other :) -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
a little photo... bad quality (with iPhone) but I had to post a photo here :) VERY soon, the matrix under the frontpanel, etc etc. most beautiful pictures will come thanks a lot ALL of you and TK means The King, I guess. -
I have little problem with - definition of LX_xxx - some "opcode" give error ( rgoto ...) - Symbol not previously defined (MIOS_DOUT_PinSet1) and for other call and, I don't know how I can use it with my code. I mean: I have a matrix[] that stores led state (off and colors) I think about another array: matrixBlinkState[] where 0=solid, 1=blinking if matrix[x] != 0x00 && matrixBlinkState[x] == 0x01 =======> blinking! how could I do that using this timer, which, I suppose, makes the blinking rate ?
-
hello michael, no prob for switch on & off. I'll try to do that and post it if I succeed :)
-
I'd like to make some led blinking. the most efficient way : doing that in the firmware (and not with an artificial note-on note-off message from the software interface to the device via midi......) I searched, I looked for that: http://www.midibox.o...index.php/topic,8456.msg60753.html#msg60753 1st question: can I mix asm and C naturally? I'm not sure. if yes, how I could put that in my code? 2nd question: how should I code that? I mean, should I use a particular value of a midi note on byte (velocity=xx) to make the led blinking? my matrix coding is: // we create a 1-dimensional array with 64 entries for led color storage for the clip matrix controller part // each entry consists of 1 byte coded like that: // 0x00 = OFF // 0x10 = RED // 0x20 = GREEN // 0x40 = BLUE // 0x30 = RED + GREEN = YELLOW // 0x60= GREEN + BLUE = CYAN // 0x50 = RED + BLUE = MAGENTA // 0x70 = WHITE // The meaning of the bytes can be found in the MIDI spec // (-> http://www.harmony-central.com/MIDI/Doc/table1.html) // (-> http://www.harmony-central.com/MIDI/Doc/table2.html) // (-> http://www.harmony-central.com/MIDI/Doc/table3.html) // // structure is matrix[COLUMN + 8*ROW]=COLOR static unsigned char matrix[64] = { 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 0x50,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10 }; it is the lookup table parsed every SRIO cycle. I could use another matrix as a kind of masking blinking state. if value is 0, the led is solid state if value is 1, the led is blinking (OFF/COLOR/OFF/COLOR etc etc) how could I do that?
-
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
I won't be able to do that of course. In my case, I declare it as a static unsigned char array. and I fill it by a function called at the end of init() it is VERY enough in my case! -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
I have to write a word for TK: Like Mr Jourdain said in "Le bourgeois gentilhomme" by Molière: "« Par ma foi ! il y a plus de quarante ans que je dis de la prose sans que j'en susse rien, et je vous suis le plus obligé du monde de m'avoir appris cela. »" I could write : "« Par ma foi ! il y a plus de 5jours que ma matrice de led rgb fonctionne sans que j'en susse rien, et je vous suis le plus obligé du monde de m'avoir appris cela [Monsieur Thorsten Klose] » It could be translated... but it is a very old french and I'm sure I can't translate it correctly in a pretty old english :( -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
I'm not as expert as you, but I'm not sure that this behaviour is a bug. I let you, all experts, to have a debate here. I'd be interested by reading you. btw WickedBlade, it works :) -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
I guess it isn't a bug, but a thing to know/learn. I only booted and waited for light... the matrix was initialized with 0, and never been modified cause I just waited for ... const are loaded. static aren't. If I had tested by sending midi notes, the protodeck would have answer by lighting up led... -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
by changing static to const and by commenting the line where I change matrix[] value to avoid error (we cannot change a const...) I have to say: IT WORKS! so, my code worked and I didn't know that. Thorsten, you just rocks! pictures/movie asap! -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
ok thorsten const is only for testing... ok i didn't understand... indeed, setting value at startup isnt too difficult. I'll do that. btw, the array you quoted from mike isnt thé same array we're tallig about. thanks a lot thorsten I'll keep the community informed about that. -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
I have to add something: noofny/mike and I use a very similar code (mine is inspired by his one) here on his site: http://www.noofny.net/files/ain64_din128_dout128_v2b_CORE_1.zip, we can find the code for one of his core. - his LUT is static - he uses the ISR to display led by calling DisplayLED() function and it works fine for him. I'm really stuck. I'd like to test things, but I don't know what to test now. should I rebuild my toolchain? should I rebuild processor specific *.lib? should I burn all ? :o :o -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
it doesn't compile: indeed, I have to set matrix[] value during running time. const cannot be write over, right? I need to write in this lookup table. (maybe I use an uncorrect term and it isn't a lookup table) -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
Hi Thorsten, I'll test it in around 3 hours and post here asap. thanks a lot for the explanation. -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
as it is a little bit upper, the summarize of the problem is : [iurl=http://www.midibox.org/forum/index.php/topic,14109.msg121487.html#msg121487]here[/iurl] -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
you're right. the hardware works. the code doesn't ??? -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
Ok. thanks lucem for your confirmation. as I wrote, indeed, if I replace the DisplayLED() call by directly MIOS_DOUT_PinSet() correclty feeded by SR pin values, I see blue, red, green, red +blue etc etc all is fine, stable, no flickering. no strange current problem etc etc! the problem is the parsing of my unsigned char lookup table ??? ??? ??? ??? ??? ??? ??? ??? ??? I'm stuck ... -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
lylehaze, here is the diagram attached. we discussed with lucem about that, as I didn't use BC547 before... I rewrite: without using the Lookup table, all (seems) to work fine. I mean: I can light up x,y led, I can "choose" the color etc. So, considering that, could it be a NPN/PNP problem? I mean, if it was, nothing wouldn't work no? -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
hello lylehaze, thanks for the post, but... indeed by reading the code, we can see that thé hardware works fine! if i dont use this lut, it works fine i can control colors, x,y led position etc. -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
unfortunately, I don't have any 18F452 to test if it is a processor type problem (it would be weird but when we test, we have to test ALL) PROBLEM DATA - I have a Lookup Table (LUT) which I convert to 1-dimension (C ansi only specifies that and multi-dimensional array are weird - thanks lucem to be my spiritual code guide) // 0x00 = OFF // 0x10 = RED // 0x20 = GREEN // 0x40 = BLUE // 0x30 = RED + GREEN = YELLOW // 0x60= GREEN + BLUE = CYAN // 0x50 = RED + BLUE = MAGENTA // 0x70 = WHITE static unsigned char matrix[64] = { 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, 0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, 0x00,0x30,0x00,0x50,0x00,0x70,0x00,0x00 }; - I have a function to parse this LUT : DisplayLED() void DisplayLED(unsigned char column, unsigned char color) __wparam { color >>= 4; MIOS_DOUT_PinSet(column+8,(color & 0x01)); // RED color >>= 1; MIOS_DOUT_PinSet(column+8+8,(color & 0x01)); // BLUE color >>= 1; MIOS_DOUT_PinSet(column+8+8+8,(color & 0x01)); // GREEN } - I have a SR_Service_Prepare() that called cyclically the LUT parser: void SR_Service_Prepare(void) __wparam { // HELPED BY BUGFIGHT => http://www.midibox.org/forum/index.php/topic,12786.0.html static unsigned char row; static unsigned char lastrow; unsigned int x; row = ++row & 0x07; // 8 cycle = 6.25% duty cycle MIOS_DOUT_PinSet0(lastrow); // lastrow OFF MIOS_DOUT_PinSet1(row); // current row ON for (x = 0; x < 8; x++) { DisplayLED(x , matrix[x+row*8]); // for the row row, cycle of all column } lastrow = row; } TEST RESULTS this code doesn't light up any led. if I replace DisplayLED(x , matrix[x+row*8]); in the ISR by DisplayLED(x , 0x10);, all the matrix is RED, without any flickering, and it is beautiful :) Of course, if I replace it by 0x20, or 0x50 etc ... it works fine with the correct color ! CONCLUSION the LUT parser doesn't work and I really don't know why !!! I have no warning at the compilation state. nothing strange appears. I tried to force unsigned char cast but it is all the same. Is it a function call problem? a type problem? a curse problem ? ;) How could I make it working? I add one question:should I recompile the 18F4620 libs for sdcc ? -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
array is 8x8 so inverted or normal are the same thing (I mean, it cannot cause an error with a outbounds or something like that!) -
[solved/ keyword static and LUT] common anode matrix & ISR
protofuse replied to protofuse's topic in MIOS programming (C)
could you explain me why the code equals always 0? 0x10>>4 = 1 1&0x01 = ..... 1 no? so for 0x10 it equals 1 for the red component....