
altech0000
Members-
Posts
7 -
Joined
-
Last visited
Never
About altech0000
- Birthday 01/01/1
Profile Information
-
Gender
Not Telling
altech0000's Achievements

MIDIbox Newbie (1/4)
0
Reputation
-
Beginner DOUT/LED Question, Need Help
altech0000 replied to altech0000's topic in Testing/Troubleshooting
Sorry about the whole editing thing, I really didn't mean to do it that way, I posted and then performed another quick test and was going to edit it in there, well it took me some time to do it and after I had finished editing it, I realized that you had posted again. I usually mark it with an EDIT: but I didn't this time. Also sorry about not posting earlier, my grandmother got sick and we had to take her to the hospital, I just got back about thirty minutes ago and just got everything wired up to fully test my theory. Skip if you don't want to hear ramblings After about ten minutes in the hospital I got to thinking on my circuit, I knew the SRIO is good and your code worked when it was turning on all the pins so it couldn't be the designed hardware so it must be my wiring. After getting back I looked at the board and realized the error of my thinking. when I was assembling the DOUT board, after I go the second to last header soldered in I notice a DO on that header (what I didn't realize was that was header J6), without looking or thinking I assumed that the pins would be labeled D0 through D32, and only looking at the one header the whole time I never realized that every header had a D0 through D7. So when trying to turn on the led at D0, the led was actually on D32 (Pin 31). After looking I noticed that the headers all had D0-D7 on them, then I looked at the header number and thats when I figured it out. I hooked the led to DO of J3, still didn't work, then I remeber looking over the forums that thats when I remeber some post about the boards being backwards, thats when I tried it on D7 and presto, it worked like a charm. Okay we are back Suffice to say that the led hooked up to the wrong pin, the exact opposite pin, was what was causing the problem. Thanks for all your help, now I can rest a little knowing that I can finish his project. Here is the finished code for the project. void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam { // a note event provides 128 different note values (0..127) // in this simple example, each note sets an individual pin // for DOUT pin numbers, see also this documentation: // http://www.ucapps.de/mios/mios_pin_list.txt int tempmyvar; switch ( evnt1 ) { case 60: tempmyvar = 0; break; case 62: tempmyvar = 1; break; case 64: tempmyvar = 2; break; case 65: tempmyvar = 3; break; case 67: tempmyvar = 4; break; case 69: tempmyvar = 5; break; case 71: tempmyvar = 6; break; case 72: tempmyvar = 7; break; default: tempmyvar = 254; break; } if( tempmyvar == 254) { } else { if( evnt0 == 0x80 || evnt0 == 0x90 ) { // 90 xx 00 is the same like a note off event! // (-> http://www.borg.com/~jglatt/tech/midispec.htm) if( evnt0 == 0x80 || evnt2 == 0x00 ) { // Note Off MIOS_DOUT_PinSet(tempmyvar, 0); } else { // Note On MIOS_DOUT_PinSet(tempmyvar, 1); } } } } here is a quick and dirty video of the board working (be sure to read the info below the video) http://www.youtube.com/watch?v=GbEYbXMfoYE Here you go Brian Sorry for the poor quality, this is just a demo for the friend that this circuit was built for his project. NOTICE: The lag that is in the video isn't there in real life, my camera just sucks. For those of you who are not Brian: I built the smashtv CORE and DOUT module kit. The triac board was just perfed. This is just a video of the channel status lights on the triac being controlled by the DOUT module that is being controlled by the CORE module that is being controlled by streaming midi commands from Sony Acid. Lights programed by me in Acid in about ten minutes to the song In-a-gadda-da-vida by Iron Butterfly. The triacs aren't acutally hooked up to the 6 50W light bulbs that board is mean't to hand, this is just the status lights. Thanks so very much for all your help. I don't know if I would have figured it out in time had you not led me down the path you did. Thanks for everything, Albert -
Beginner DOUT/LED Question, Need Help
altech0000 replied to altech0000's topic in Testing/Troubleshooting
Okay I edited my post above so check that out again. Now, I will start doing it that way, I have been doing it several different ways, that being one of them. Your code works, I press a key on the keyboard and the led comes on. The problem I am having now is getting pinset to work. If I write it like this, MIOS_DOUT_PinSet(0,1) then the led won't come on when I press a key. At least I am making progress. -
Beginner DOUT/LED Question, Need Help
altech0000 replied to altech0000's topic in Testing/Troubleshooting
Yea I really have fun with these types of things. Yes I did use smart and wait, re-uploaded mios again though. Just to make sure I am doing this right, when I upload my compiled hex file, I don't use the wait do I? and am I supposed to wait longer than 2 seconds before I start the upload? I saw that test on the forum before and I wondered what they were talking about, now I know. Just wrote a program to echo the midi input, tried it with this code but it didn't work: void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam { MIOS_MIDI_TxBufferPut(evnt0); MIOS_MIDI_TxBufferPut(evnt1); } Then I thought that maybe you had to send it in 3 byte increments, added evnt2 to that list and it works, I press a key on the keyboard and it echos back to the midi in. Finally something that works. This is a picture (a poor picture) of how the DOUT board is hooked up to the CORE. Note: The red lines only hook to the second row of pins on the J1 header of the DOUT board, not both rows. (Sorry about the quality, don't really like paint) Hope this clears it up a little. I haven't tried the SRIO or your code yet, I will be trying that in about two or three hours. One question, what is the purpose of 0xff in the MIOS_DOUT, I thought that is should be either 0 or 1. About the led, I don't think it is backwards because it will briefly flash when the board is powered up though I will definitely try it. I have now tried the SRIO test, that works, I get 5 volts at each pin on each modulation. I tried your code and that works. Now the problem is if I replace the i in MIOS_DOUT with a 0 (Pin D0) then the light won't turn on. Thanks for the help, Albert -
I really hate to start another thread about DOUTs as I really thought I had this figured out but I apparently haven't. What I have is the core module and a DOUT module from smashtv. I have finally gotten the compiler to work after following the wiki and this link http://www.midibox.org/forum/index.php?topic=7238.0. I was able to compile the skeleton without any trouble. What I am trying to do is turn on 8 different relays depending on which note is send by midi (notes being C4 to C5 no sharps or flats). I started out simple by just writing the program to turn on the LED on DO and VS of the DOUT module when a midi event was received. Here is the program: // $Id: main.c 333 2008-05-10 20:49:56Z tk $ /* * MIOS SDCC Wrapper * * ========================================================================== * * Copyright (C) <year> <name> (<email>) * Licensed for personal non-commercial use only. * All other rights reserved. * * ========================================================================== */ ///////////////////////////////////////////////////////////////////////////// // Include files ///////////////////////////////////////////////////////////////////////////// #include <cmios.h> #include <pic18fregs.h> ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS after startup to initialize the // application ///////////////////////////////////////////////////////////////////////////// void Init(void) __wparam { // set shift register update frequency MIOS_SRIO_UpdateFrqSet(1); // ms // Up to 4 DOUTX4 modules (=16 shift registers = 128 digital outputs) can be connected // set the maximum number here - it doesn't really hurt! MIOS_SRIO_NumberSet(4); } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS in the mainloop when nothing else is to do ///////////////////////////////////////////////////////////////////////////// void Tick(void) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is periodically called by MIOS. The frequency has to be // initialized with MIOS_Timer_Set ///////////////////////////////////////////////////////////////////////////// void Timer(void) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when the display content should be // initialized. Thats the case during startup and after a temporary message // has been printed on the screen ///////////////////////////////////////////////////////////////////////////// void DISPLAY_Init(void) __wparam { MIOS_LCD_Clear(); MIOS_LCD_CursorSet(0x00); MIOS_LCD_PrintCString("Hello World!"); } ///////////////////////////////////////////////////////////////////////////// // This function is called in the mainloop when no temporary message is shown // on screen. Print the realtime messages here ///////////////////////////////////////////////////////////////////////////// void DISPLAY_Tick(void) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when a complete MIDI event has been received ///////////////////////////////////////////////////////////////////////////// void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam { MIOS_DOUT_PinSet(0, 1); } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when a MIDI event has been received // which has been specified in the MIOS_MPROC_EVENT_TABLE ///////////////////////////////////////////////////////////////////////////// void MPROC_NotifyFoundEvent(unsigned entry, unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when a MIDI event has not been completly // received within 2 seconds ///////////////////////////////////////////////////////////////////////////// void MPROC_NotifyTimeout(void) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when a MIDI byte has been received ///////////////////////////////////////////////////////////////////////////// void MPROC_NotifyReceivedByte(unsigned char byte) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS before the shift register are loaded ///////////////////////////////////////////////////////////////////////////// void SR_Service_Prepare(void) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS after the shift register have been loaded ///////////////////////////////////////////////////////////////////////////// void SR_Service_Finish(void) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when an button has been toggled // pin_value is 1 when button released, and 0 when button pressed ///////////////////////////////////////////////////////////////////////////// void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when an encoder has been moved // incrementer is positive when encoder has been turned clockwise, else // it is negative ///////////////////////////////////////////////////////////////////////////// void ENC_NotifyChange(unsigned char encoder, char incrementer) __wparam { } ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when a pot has been moved ///////////////////////////////////////////////////////////////////////////// void AIN_NotifyChange(unsigned char pin, unsigned int pin_value) __wparam { } As you can tell this is just the skeleton wrapper with the Init and Event modified. This didn't work. I have tried various different things, even putting the MIOS_DOUT_PinSet(0, 1); statement in the Init section, hoping to get the light to turn on when I power the board up. No success. Now for the rest of the details: R5 DOUT board from smashtv R4 CORE board from smashtv The PIC16F452 was bought separately and I programmed the bootloader and then uploaded MIOS via MIOS Studio Every time I power up the board I get the one sysex message. After that I did a hex upload of the compiled program above If you look at the CORE board with the midi connectors facing away from you I have wired the CORE to the DOUT in left to right order when the DOUT is facing so the J1 is the farthest from you but on the inside row of J1 (if you need a pic let me know) The led will flash once when I plug in the power supply to the CORE but will never turn on again For the initial "led comes on when a even is received" the keyboard from MIOS and the keyboard from MIDI-OX were used to send the midi command 90 3C (note on, C4) I am really amazed at all this board can do, I really want to build a SID even thought I don't know what it is used for right now. I'm not new to electronics only to midi circuits and midi music creation. I know it will be a while before I even attempt at making a SID or begin to understand what it does though I will keep reading until I do because this site and project really intrigues me. I really would have looked for about another two days before asking this question but I am working on this project for a friend and is due in about seven days. PS In case your wondering, the application for this project is for my friends finial project for a visual arts, He was allowed to choose anything he wanted and get help from people to build it, the only requirement was that it contained lights. What he wanted to do was have a light show that was programmable by some software on the computer and have it flash lights to the music played. I have been experimenting with microcontrollers and doing electronics (for about four years on the general electronics and about a year in microcontrollers, just a tinkerer, nothing big, one past project, wireless gate opener) and I suggested he use midi so that is how I found this site. The light show will work like this: He will program the light patterns into a MIDI track in Sony Acid using the notes mentioned above then it will output it to the CORE and it will translate to a digital output via the DOUT module which will then switch opto-coupled triacs to control six 120VAC 50W light bulbs. Thanks for any help you have to offer as it will be greatly appreciated, Albert
-
Thanks for that too, I am definitely going to do that.
-
Thanks for the welcome and the help, I had never found that page before, that cleared it all up for me (at least for now). Yes this is my roommates project but he was looking at spending about 250 dollars for a professional midi to relay box and I told him I could build it for cheaper, plus I love building things and I am good at electronics. He is great at the art side and good at (better than me) programming and I can help with the hardware side. Again, Thank You so much.
-
Hello, I have this problem. I have a roommate and he is doing an art thing for his final project that involves eight lights that need to be turned on and off with distinct patterns(ie programmable). He is okay at coding in VB and I am okay with electronics and PICs with PICBasic Pro. So what I was going to do was have him right a VB program that was basically a channel sequencer(when to turn the lights on and off) and I was going to write the code and design the circuit for a 16F628A chip that would accept a string of serial characters that would be translated into with relay being on or off. I got to thinking and then I thought about MIDI and I was like, why reinvent the wheel? So I did some research and I landed here, with the MIDIBox. So basically what I want to do is, he would set in a MIDI editor a C0 note to play and then as long as it is playing the light would be on(this isn't set in stone, I just kind of figured it that way, it could also be just a C0 note pulse to turn it on and then another C0 pulse to turn it off later.) My question is: 1) When using the DOUT module how do you control what output gets turned on/off when? (Do I have to write or modify asm for this?) Thanks for any help, Albert P.S. There will probably be a few more questions before this is done, just can't think of any right now.