Jump to content

Poivrelec

Members
  • Posts

    16
  • Joined

  • Last visited

About Poivrelec

  • Birthday 12/14/1987

Profile Information

  • Gender
    Male

Poivrelec's Achievements

MIDIbox Newbie

MIDIbox Newbie (1/4)

0

Reputation

  1. Hi Phil, thank you Sadly, I had to move last week and I don't have a DMX fixture anymore, nor a Scope to go on with my tests... It might take a few weeks for me to be able to work on that project again I'll keep you all posted as soon as anything goes on of course
  2. Hi, Thank you for your answer I think I'm using J12 since i use a DIN connector directly into the MIDI port... Do you think maybe the resistors are the problem ? And I should use J11 Instead ? Edit : There is no physical J11 on the LPC17 board, that might explain why I was looking for it without success ^^
  3. What I did is read from here http://www.ucapps.de/mbhp/mbhp_core_lpc17.pdf and used - the pin that is connected to R21 (and then P2.0) as the 'input' of the adruino shield - the middle pin for the ground - and the +5V supply of the board as the +5V (At first I used the pin that is connected to R22 and then +3.3V)
  4. Hello again, Sorry for the absence. I purchased two days ago a rs-485 transciever, in order to symmetrize the signal, and to have it +5V. I followed this schematic : http://playground.arduino.cc/DMX/DMXShield Again, with a LED, I have some blinking (at least I guess its blinking and not continuous), but I can't try it on the scope for now. I hope I will be able to do so soon. This time, nothing at all happens with the fixture, not even random blinking... Maybe I missed something while following the schematic, do you guys see anything abviously wrong about it ? Thanks again !
  5. I was re-reading the thread and realized I didn't answer to your question, sorry : I understood that Phil achieved this with the two stop bits of the break signal. Because the baud rate was slower, it seemed to be long engouth. So I did the same :) // Setup to break Baudrate DMX->LCR = 0x87; // 8 bits, no Parity, 2 stop bit, no break, DLAB=1 DMX->DLM = (break_br_diviserOptimal >> 8) & 0xff; DMX->DLL = break_br_diviserOptimal & 0xff; DMX->LCR = 0x03; // disable access to divisor latches DMX->FDR = ((break_br_mulFracDivOptimal&0xf) << 4) | (break_br_dividerAddOptimal&0xf); DMX->FCR = 0x07; // Enable and reset TX and RX FIFO // break code DMX->THR = 0x00; // State dmx_state=DMX_BREAK; Then the interrupt deals with end of transmission, switches to DMX_SEND, sets up the higher baud rate, sends the universe...
  6. Hi kpete, You answer is very interesting and helpful, thanks a lot ! I have been able to quickly use a scope yesterday, and will continue today on my free time (I don't have much lately). What I got is a signal that seemed more or less stable, but there were some interrogations. I think I'll have to test it in much more proper conditions and a bit longer if I want to find out what's going on :) At least, I got something looking like bytes... Reading your post and the links you provided, I will probably use a buffer to generate a good 5V symmetrical signal. For now I will focus on getting the software part right (generating the break and sending the universe correctly), and when this is done, I'll switch to the hardware part and probably order some parts, maybe use other pins of the motherboard to be able to use MIDI Uarts along with DMX sending... there is a lot of work ahead of me :) I will think about what you said about the MAB, and try it as soon as I can, it might help the fixture to understand what I'm trying to tell it. I'll keep you posted as soon as I get results, Thanks again !
  7. I just found that aboud DMX on http://www.pangolin.com/LD2000/dmx-about.htm So maybe the fact that LPC17 doesn't provide more than 3.3V won't be a problem after all
  8. Hi kpete, Thank you for your answer :smile: I was trying to connect it directly to the LPC17, because I thought that Phil achieved that possibility in his module for the STM32. My only doubt was about how to do it on a LPC17. Then I read about EIA-485, and checked the Midibox motherboard (LPC17 core) sheet and started to doubt more ^^ I wasnt really sure that Phil managed to completely get rid of the hardware layer, but he seemed so when he wrote the module for the STM32 () : (And now that I read it again, I realize it might still need a SN75176 differential bus transceiver but no a IIC anymore) I found this morining that on the pdf from NXP about the LPC1769 : I'll try to figure out if I can achieve UART1 to be configured as RS-485 and if its compatible with the midibox motherboard :smile: I coulnd't use the scope yesterday, maybe today, I'll keep you posted ! Again, thanks for your help :smile:
  9. Thank you TK for your quick answer ! I am aware that there is a lot to read, I put it all in case something was obviously wrong to any of you, i'm really new to microcontrollers, i probably missed something. I still hope Phil Taylor will stumble upon this thread, as he is probably very aware of DMX specifications I will change the line as you suggested, as you say, it's best to ensure I'll keep you posted as soon as there is anything new, thank you again for your help :)
  10. Hello again, First of all, sorry for the very long post I managed to understand some things since last time. I think I might have found a way of making this work, but there is something I still can't figure out. What I'm doing in my module is initializing UART1 with the same commands in mios32_uart.c : // TX MIDI1: P2.0 MIOS32_SYS_LPC_PINSEL(2, 0, 2); MIOS32_SYS_LPC_PINMODE(2, 0, 2); MIOS32_SYS_LPC_PINMODE_OD(2, 0, 1); // RX MIDI1: P2.1 w/ pull-up enabled MIOS32_SYS_LPC_PINSEL(2, 1, 2); MIOS32_SYS_LPC_PINMODE(2, 1, 0); Then I pre calculate the baudrate (copy/paste of mois32_uart. again), and store both fast and slow value : [... copy from mios32_uart.c with baudrate 250000] // Store for fast changes dmx_br_diviserOptimal = diviserOptimal; dmx_br_mulFracDivOptimal = mulFracDivOptimal; dmx_br_dividerAddOptimal = dividerAddOptimal; [... copy from mios32_uart.c with baurdate 40000] // Store for fast changes break_br_diviserOptimal = diviserOptimal; break_br_mulFracDivOptimal = mulFracDivOptimal; break_br_dividerAddOptimal = dividerAddOptimal; So I can easily configure ports using dmx_br_ or break_br_ // Setup to DMX DMX->LCR = 0x87; // 8 bits, no Parity, 2 stop bit, no break, DLAB=1 DMX->DLM = (dmx_br_diviserOptimal >> 8) & 0xff; DMX->DLL = dmx_br_diviserOptimal & 0xff; DMX->LCR = 0x03; // disable access to divisor latches DMX->FDR = ((dmx_br_mulFracDivOptimal&0xf) << 4) | (dmx_br_dividerAddOptimal&0xf); DMX->FCR = 0x07; // Enable and reset TX and RX FIFO Then I configure the interrupt as in mios32_uart.c DMX->IER = (1 << 1) | (1 << 0); // enable RBR and THRE (receive/transmit buffer) interrupt MIOS32_IRQ_Install(DMX_IRQ_CHANNEL, MIOS32_IRQ_UART_PRIORITY); As in Phil Taylor's module // Create timer to send DMX universe. vSemaphoreCreateBinary(xDMXSemaphore); xTaskCreate(TASK_DMX, (signed portCHAR *)"DMX", configMINIMAL_STACK_SIZE, NULL, PRIORITY_TASK_DMX, NULL); In the task, I copied Phil's module, but using break_br_ variables to setup the port and send the break when in IDLE state static void TASK_DMX(void *pvParameters) { portTickType xLastExecutionTime; // Initialise the xLastExecutionTime variable on task entry xLastExecutionTime = xTaskGetTickCount(); while( 1 ) { vTaskDelayUntil(&xLastExecutionTime, 35 / portTICK_RATE_MS); if (dmx_state==DMX_IDLE) { if (xSemaphoreTake(xDMXSemaphore, 10)==pdTRUE) { // Stop the universe from being changed while we are sending it. // Setup to break Baudrate DMX->LCR = 0x87; // 8 bits, no Parity, 2 stop bit, no break, DLAB=1 DMX->DLM = (break_br_diviserOptimal >> 8) & 0xff; DMX->DLL = break_br_diviserOptimal & 0xff; DMX->LCR = 0x03; // disable access to divisor latches DMX->FDR = ((break_br_mulFracDivOptimal&0xf) << 4) | (break_br_dividerAddOptimal&0xf); DMX->FCR = 0x07; // Enable and reset TX and RX FIFO // break code DMX->THR = 0x00; // State dmx_state=DMX_BREAK; }}}} And finally in the interrupt, I deal with end of transmissions (THRE) : If we were in DMX_BREAK state, I switch to DMX_SEND. If we are in DMX_SEND, I upadate the register with the next channel byte. Until there is no channel left, then switch to IDLE state, which will allow the task to send a new break and so on... signed portBASE_TYPE x=pdFALSE; DMX_IRQHANDLER_FUNC { u32 iir_intid = DMX->IIR & 0xe; // IIR will be released with this access if( iir_intid == 0x2 ) { // IntId = 0x1 (THRE) End of transmission // If we were sending break if(dmx_state == DMX_BREAK) { // Reset Channel dmx_current_channel=0; // Setup to DMX baudrate DMX->LCR = 0x87; // 8 bits, no Parity, 2 stop bit, no break, DLAB=1 DMX->DLM = (dmx_br_diviserOptimal >> 8) & 0xff; DMX->DLL = dmx_br_diviserOptimal & 0xff; DMX->LCR = 0x03; // disable access to divisor latches DMX->FDR = ((dmx_br_mulFracDivOptimal&0xf) << 4) | (dmx_br_dividerAddOptimal&0xf); DMX->FCR = 0x07; // Enable and reset TX and RX FIFO // start code DMX->THR = 0x00; // State dmx_state=DMX_SENDING; } // If we were sending a channel if(dmx_state == DMX_SENDING) { // If not all channels sent if( dmx_current_channel<DMX_UNIVERSE_SIZE ) { // Get current channel byte s32 b = DMX_GetChannel(dmx_current_channel); // If unable to get channel byte if( b < 0 ) { // Send zero in case of doubt b = 0x00; } // Transmit channel byte DMX->THR = b; // Next channel dmx_current_channel++; } // All channels have been sent else { // State dmx_state=DMX_IDLE; xSemaphoreGiveFromISR(xDMXSemaphore,&x); } } } } The program is running fine, with no hangs or error messages. But when I wire a dmx led bar to the uart, nothing expected happens (random blinking or blackout, but the bar says some DMX is entering, not sure if proper DMX though). I dont have an oscilloscope (but will probably be able to use one tomorrow). So I pluged a LED and it lighted and blinked rapidly, so something is going out of that UART ^^ My question is (after all this text ^^) how would one be sure that the UART pins are correctly configured ? I read in Phil's module that they're supposed to be push-pull outputs, but I couldn't find how to check that on a LPC1769. Also I'm not sure I 'copied' right the part where the baudrate are set. Edit : On the LPC17 core sheet, it says that J12 (MIDI Out 1) is : TXD1 / GND / 3.3V, that's my main concern actually, as I am not sure it can match DMX+ / GND / DMX- I know it's a lot to read, probably not very clear, but if someone has a hint on how to check that (code-side), or knows better how to do pin configuration on a LPC17, I would be very happy :smile: I'll continue my tests anyway, and and of course share my results with you when/if I succeed Thanks in advance, Poivrelec
  11. Hi ilmenator, Thanks for your reply, but I already have mounted a basic LPC17 + SCS about 8 months ago, and I haven't planned on buying and mounting a STM32F4 core yet. I hope I can get my LPC17 core to deal with sending dmx from UART writing a dedicated module In the future I will probably try the STM32F4, it seems to be a very interesting and versatile core module
  12. Hello again everyone, I haven't had a lot of free time since last time, but I was able to figure out some things about dmx and midiboxes. But i'm still unable to start working on my project, since I'm really new to microcontrollers programming. Apparently, the dmx.c module written by PhileTaylor is using commands that are not part of the hardware abstraction layer of MIOS32, and it is written for the old STM32 core module. I read on the internet about GPIOs, baudrate and such, not figuring everything out, but that allowed me to have a global vision of Phil's module. What I am looking for now is help for translating that module for LPC17 cores. Looking at the files on the SVN, it seems that the way uart ports are configured for LPC17 is way different from old STM32. Maybe one of you can give me a hint on where to look if I want to manually configure UART port(s) of LPC17 using MIOS32. I tried to figure it out by myself, looking at the com and the midi_uart modules, but sadly my knowledge and understanding reached their limits before I could start trying to code anything... Sorry if I missed a page where everything is already explained, I looked all the places I know without success, and now that I have some free time again, I would love to work on a working dmx module for LPC17 cores :) Thanks in advance to you all ! Poivrelec
  13. I was talking about Midiboxes based on LPC17 core ^^, it seems that they outed in 2010 I would really like to try some stuff with the dmx module written by philetaylor, but I didn't get how to route the out to the correct ports...
  14. Hi novski ! Thanks for your reply. I saw that user project, but it seems that it is based on a STM32 core with an IIC... and I don't know how I could translate that into LPC17 based code ^^ Maybe i should undig this topic : The LPC17 core wasnt out in May 2010 right ?
  15. Thanks latigid on ! I was asking about the MIDI ports because I understood they were uart, so maybe some reconfiguration could get me somewhere since I think DMX requieres a certain baud rate... But i think other pins can be used as uart too, I'm quite new to that stuff, so I'm a bit lost ^^ Sadly the research for 'dmx' in this forum does not give anything, thats why I dared to create a new post ^^ Thank you Thorsten ! I hope Philetaylor will read this post too... The only previous work on DMX i could find was on a old core, and that got me even more lost in my understanding of MIOS :smile: Best Regards
×
×
  • Create New...