Jump to content

Phatline

Members
  • Posts

    1,258
  • Joined

  • Last visited

  • Days Won

    67

Phatline last won the day on April 25

Phatline had the most liked content!

About Phatline

  • Birthday 02/04/1983

Contact Methods

  • Website URL
    http://www.siglgut.at

Profile Information

  • Gender
    Male
  • Location
    upper-austria
  • Interests
    Jam, Soundmorph, Subtraktiv, Program, Design, soldering, and all else about frequency > live > life > nature > earth > building

Recent Profile Visitors

8,114 profile views

Phatline's Achievements

MIDIbox Guru

MIDIbox Guru (4/4)

118

Reputation

  1. Hei I have some SPI problems here... A AINSER slows down the SD-Card Access - so the programm is not usable anymore. I already optimized the Ainser-Side (see below), but that is not enough, I dont know if it is the prescaler Factor, that also changes SD-Card in a way (since booth are SPI...) I save a lot off informations on the SD-Card, so each percent off performance makes seconds off less waiting time. Is there something like a prescaler that can be set for the SD-Card?= How give the SD-Card more priority? I know how to give prioritys for RTOS Task that i created, but i dont know how to do that with SD-Card (on rootlevel) thx for any info! I have 2 AINSER8 moduels connected to a STM32F4(disconver), not multiplexed - i have 16 faders connected directly to them. as soon i scan the AINSER: static void TASK_AINSER_Scan(void *pvParameters){ // This task scans AINSER pins and checks for updates portTickType xLastExecutionTime; xLastExecutionTime = xTaskGetTickCount(); while( 1 ) { vTaskDelayUntil(&xLastExecutionTime, 10 / portTICK_RATE_MS); // 202 orginally 1ms // scan pins AINSER_Handler(APP_AINSER_NotifyChange); } } The Write or Read on the SD-Card goes up from 1seconds to 14seconds (in my case) so i copied the ainser.c to my project, and made some edits, the most significant emprovement was to change the prescaler from 64 to 8: // init SPI port for fast frequency access MIOS32_SPI_TransferModeInit(2, MIOS32_SPI_MODE_CLK0_PHASE0, MIOS32_SPI_PRESCALER_8); // Initialisierung des SPI-Ports i also tryd other values, but on some values the Ainser didnt react at all, or i got random values. When i remove this Prescaler LINE, the AINSER gives no output to my code, what makes me a bit wondering since in MIOS-FUNCTIONS there is statet: So my expirience - the Prescale may not have a effect on SPI2, but on SPI0 (where my SD-Card is connected). I also changed to get this Prescaler8 working, The driver from MIOS32_SPI_PIN_DRIVER_STRONG to MIOS32_SPI_PIN_DRIVER_WEAK (which is i know not recommented): // pins in push-poll mode (3.3V output voltage) MIOS32_SPI_IO_Init(2, MIOS32_SPI_PIN_DRIVER_WEAK); // 2: Ainser_SPI - J19 i then tryed to remove the Multiplexer Code, and fixed the modules to a count off 2, At the end i have 4 seconds Access Time to my SD Card which was without AINSerial 1second And without my modifications 14 seconds I already set the priority off Tasks like this: // TASK - PRIORITYS #define PRIORITY_TASK_SEQ ( tskIDLE_PRIORITY + 5 ) // higher priority than MIDI receive task! #define PRIORITY_SD ( tskIDLE_PRIORITY + 3 ) #define PRIORITY_LOPRIO ( tskIDLE_PRIORITY + 2 ) #define PRIORITY_LCD ( tskIDLE_PRIORITY + 0 ) // idle #define PRIORITY_PAD ( tskIDLE_PRIORITY + 0 ) // idle #define PRIORITY_TASK_AINSER_SCAN ( tskIDLE_PRIORITY + 0 ) // orginal this was 3 So the SD-Task (where i write things on the SD-Card with mutexes and stuff...) is already High priority > off course the SEQuencer is higher... the whole Ainser.c code then looked like this: #include <mios32.h> #include "ainser.h" #include <string.h> ///////////////////////////////////////////////////////////////////////////// // Local variables ///////////////////////////////////////////////////////////////////////////// static u8 ainser_enable_mask; static u8 ainser_muxed_mask; static u16 ain_pin_values[16]; //2 Modules 8 pins static u16 previous_ain_pin_value; const u8 pin_lookup[8] = {7,6,5,4,3,2,1,0}; ///////////////////////////////////////////////////////////////////////////// // Local Prototypes ///////////////////////////////////////////////////////////////////////////// static s32 AINSER_SetCs(u8 module, u8 value); ///////////////////////////////////////////////////////////////////////////// //! Initializes AINSER driver //! Should be called from Init() during startup ///////////////////////////////////////////////////////////////////////////// s32 AINSER_Init(u32 mode){ // pins in push-poll mode (3.3V output voltage) MIOS32_SPI_IO_Init(2, MIOS32_SPI_PIN_DRIVER_WEAK); // 2: Ainser_SPI - J19 // orginal this was MIOS32_SPI_PIN_DRIVER_STRONG MIOS32_SPI_PIN_DRIVER_WEAK // ensure that CS is deactivated AINSER_SetCs(0, 1); // CS für Module 0 AINSER_SetCs(1, 1); // CS für Module 1 // Dont use Muxes ainser_muxed_mask &= ~3; // Sets the enable mask for modules which should be scanned ainser_enable_mask |= 3; // clear all values memset(ain_pin_values, 0, sizeof(ain_pin_values)); previous_ain_pin_value = 0; return 0; } ///////////////////////////////////////////////////////////////////////////// //! This function should be periodically called to scan AIN pin changes. //! A scan of a single multiplexer selection takes ca. 50 uS on a LPC1769 with MIOS32_SPI_PRESCALER_8 ///////////////////////////////////////////////////////////////////////////// s32 AINSER_Handler(void (*_callback)(u32 module, u32 pin, u32 value)) { static u8 first_scan_done = 0; // Variable zur Verfolgung des ersten Scans // init SPI port for fast frequency access MIOS32_SPI_TransferModeInit(2, MIOS32_SPI_MODE_CLK0_PHASE0, MIOS32_SPI_PRESCALER_8); // Initialisierung des SPI-Ports // loop over connected modules int module; int chn; for (module=0; module<2; ++module){ // Schleife über die angeschlossenen Module for (chn = 0; chn < 8; ++chn) { // Schleife über die Kanäle AINSER_SetCs(module, 0); // Setzen des Chip-Select-Pins auf LOW MIOS32_SPI_TransferByte(2, 0x06 | (chn >> 2)); u8 b1 = MIOS32_SPI_TransferByte(2, chn << 6); // Übertragung der Datenbytes über SPI u8 b2 = MIOS32_SPI_TransferByte(2, 0); AINSER_SetCs(module, 1); // Setzen des Chip-Select-Pins auf HIGH u8 pin = pin_lookup[chn]; // Berechnung des Pin-Index u16 value = (b2 | (b1 << 8)) & 0xFFF; // Kombination der Datenbytes zu einem Wert previous_ain_pin_value = ain_pin_values[module * 8 + pin]; // Speichern des vorherigen Pin-Werts int diff = value - previous_ain_pin_value; // Berechnung der Differenz zum vorherigen Wert int abs_diff = (diff > 0) ? diff : -diff; // Berechnung des absoluten Werts der Differenz // Überprüfung, ob der Pin-Wert sich ausreichend geändert hat if (!first_scan_done || abs_diff > 31) { ain_pin_values[module * 8 + pin] = value; // Speichern des neuen Pin-Werts if (first_scan_done && _callback && pin < 8) _callback(module, pin, value); // Aufruf der Callback-Funktion } } } if (first_scan_done == 0) first_scan_done = 1; // Setzen der Flag, dass der erste Scan abgeschlossen ist return 0; } ///////////////////////////////////////////////////////////////////////////// // Internal function to set CS line depending on module ///////////////////////////////////////////////////////////////////////////// static s32 AINSER_SetCs(u8 module, u8 value){ switch( module ){ case 0: return MIOS32_SPI_RC_PinSet(2, 0, value); // spi, rc_pin, pin_value // 2: SPI - J19 case 1: return MIOS32_SPI_RC_PinSet(2, 1, value); // spi, rc_pin, pin_value // 2: SPI - J19 } return -1; } i use to write to SD-card directly with File.c, like this: // Speicherung der Daten auf der SD-Karte MUTEX_SDCARD_TAKE; FILE_WriteOpen ("0.p4", 8); FILE_WriteBuffer(buffer2, sizeof(buffer2)); FILE_WriteClose(); MUTEX_SDCARD_GIVE;
  2. @ Faderboard 1 & 2 Mounting holes labeling not necessery again. rest is ok. you may could label + and - beside the 2x5 shroudet Pinheaders, so there is no chance someone reverse it in a way... in generell... normally the Nose- says all, but someone could crimp the cable incorrect... so if he controll measure, this is a good hint then for him.
  3. @ pusbutton: the LEDs in the shematic are REVERSED for example look into: http://ucapps.de/mbhp/mbhp_doutx4_32leds.pdf but in the board itself the Silkscreen for the Diode is painted correct - so if somebody just solder the PCB without looking into the Shematic - all is good, when someone look into the shematic he may be confused a bit. what type off Switch are using here > type it on the silkscreen - like you did on the Potentiometerboard. because: i see in the footprint its a le mec > then there are different types, with different Switch contacts - like you see here: 5GTH9 + 5ETH9 will work, while 5GTH9 with inbuilt LED will not work off course... i for me find the correct switch matching to your PCBs Footprint-Pinout - a bit hard... so label the type.... the rest off the PCB looks ok.
  4. @ potentiometer: looking good, but labeling the Holes is not necessery (i think) :
  5. which do you think are completely finished? at Inverting - something like this: www.siglgut.at/temp/encoder-phatty.zip @ ULN2803... normally used to drive Ledrings - because off Currentlimitations off HC595ers... didnt see them on DINs normally?! @ lack off space > use 4 Layer PCBs.... dont use Thruholeparts like your 10K Resistor network - since it will steal space on all layers - better use SMD single resistors there (when you think in Multilayer), when handsolder then you can place them on top or back where you want... if pick and place then off course only on one side... Those 2x5 Pinheaders are also aviable as SMD Parts (and also on JLCPCB as Pick and Place Parts) ... Those Pinheaders in Action on a 4 Layerboard: http://wiki.midibox.org/lib/exe/fetch.php?w=600&tok=5fb4d9&media=phatline:display-driver-smd-3d-front.jpg thinking in this terms - there is plenty off space, and you could arrange then with this new space the Shiftregisters and its Datalines in a parallel manner (at least it will be easier)
  6. maybe by removing the pull-Hi resistor off the HC165 Circuit, and using a Inverter on its inputs for example: https://www.mouser.at/ProductDetail/Nexperia/74HCT1G14GW-Q100H?qs=SKY61BOKKY4Uv%2FaFLc8SsQ%3D%3D https://www.mouser.at/datasheet/2/916/74HC_HCT1G14_Q100-2937184.pdf (just a example maybe there are better parts for this porpuse, and i dont know how hard to solder this one is) that would reverse Lo and Hi, and you could use this bloddy 3 LEDs ( where i think thats not a good idea, the Encoder is expensive - and not really a standard part...) but for that quick idea i would prototype that first (order a inverter, order a Encoder, make wires without pcb) ... specially iff any pull hi or pull low resistors are needet elsewhere, i guess you need a 10K pull-low resistor (to ground) on pin 3 off your Encoder then: HC165 > Inverter > Pull-Low + Pin3 since i have not much time these times, and you have plenty off modules what module i should check next? i just had a look on your 4x2 Enc RGB SW Led ring Rgb render here... and i am not 100% sure that the inbuilt RGB LEDs that enlighten the Encodersshaft dont shine on the LED-Ring and make them hard too read (maybe need some lightshielding)... by the way hard too read, those Alps Knobs are a bit big for that small Ledring - can you still see the LEDs when looking from a angle that is not 100% from top?
  7. by RM you meen a Ringmodulator-coil? if you can provide some specifications, i can make special Program for Ringmodulator Coils (these have a center tip on the secondary? and no center tip on the Primary? what comes in my mind: what kind off Iron-Core?, many off windings, 1:1 or is this a 1:2 because off center-tip?, wire-diameter, a Center-Break in the Program? maybe this could be managed too moove the Feeder with max speed to get something like this: START winding |.......|.......|.......|.......|.......|.......|.......| First Layer: >||||||||||||||||||||||||||||||||||||||||||||||||||||||| Next Layer:<||||||||||||||||||||||||||||||||||||||||||||||||||||||| Next Layer:>||||||||||||||||||||||||||||||||||||||||||||||||||||||| Last Layer:<||||||||||||||||||||||||||||||||||||||||||||||||||||||| CENTER winding< |.......|.......|.......|.......|.......|.......|.......| Next Layer:>||||||||||||||||||||||||||||||||||||||||||||||||||||||| Next Layer:<||||||||||||||||||||||||||||||||||||||||||||||||||||||| Next Layer:>||||||||||||||||||||||||||||||||||||||||||||||||||||||| Last Layer:<||||||||||||||||||||||||||||||||||||||||||||||||||||||| END winding< |.......|.......|.......|.......|.......|.......|.......| at the end it will look like this: |.......|.......|.......|.......|.......|.......|.......| ||||||||||||||||||||||||||||||||||||||||||||||||||||||| then Paint the Coil and dry it out - except off the " |.......|.......|.......|.......|.......|.......|.......| " Part which can be unwindet by hand, so you have then there 3 Wires to solder to the PCB... without breaking the Program - and fiddle arround at all... (aka no tension problems...) @benuron > the V-groove Rolls-Array make enough tension > at least for Tesla, or low-ampere Audio-Coil-Stuff (aka small Diameter CopperWire). But i have some thougts about the Point were it Toggle the direction this is may be a critical point indeed...
  8. its not in the code yet, since tesla coil needs only one layer. but to add a new mode is not difficult... just toggle the direction pin when a ammount off turns are arrived - i can add this... tell me when and if you begin to.build a winder - or do i missunderstand and you just need some coils to be windet?
  9. Hei Code, BOM, Shemata, and some Pictures are documented here http://wiki.midibox.org/doku.php?id=coilwinder The rest is documentadet with this Video in ENGLISH: or GERMAN: - mike.
  10. no clue... since my knowledge is need to know (me also having a hard time to absorb mios...coming more from a musical background then from programming...learnd c while exploring mios...) but maybe it is a midi mutex thing? combined with a buffer?
  11. i dont have a generic midicontroller code for the blm... i run my project "triggermatrix" on it which is in first case a note processor, in 2nd a sequencer, in 3rd a midigroovebox(without audio). for the blm part i used the blm-scalarcode and stripped it down, and mooved it into the main.c. when the blm-pcb gets into its final revision (aka oneside is pick and place - and a bulk order is on its way) i can provide a skeleton project... i am a bit busy... so thiswill take a while
  12. an arp needs the seq.c .. at least i would use it. in the seq.c i would build a simple counter 1 2 3... 1 2 3.... which only starts when aFLAG is high (aka note was pressed) ... where the max is (3) is set by a global variable which itself is set in the main.cin your UI depending on your arp steps (up dow up...upup up down)....the counters output in seq.c i would send into your arp task to trigger events.... if donewith arp stuff/or released the keypress then i would set the FLAG low, so the seq is stopped putting out triggers. i dont want to release the triggermatrix code since noone but me can understand - and the only usecase then left is thata company pirates it
  13. hei i stripped down the BLM-Project (so it cant be cloned with out weeks off routing U B ;) ) BLM-how-to.zip and i wrote some explaination... basicly i made a Grid with a center-cross - so a single button-LED-Fottprint can be placed correct to the Rubber-Button-Grid... you may have to set a a new "zero position off the Kicad Grid" to this crosses when you place the Button-LED-Fottprint on them... this Grid also have the Holes for the PCB which are needet to hold the rubber in Position.. maybe you find a "Flip-Chip" Variant for your RGB-LED... it would be better... you should not place it on the TOP side off the PCB... because it will illuminate the Neightbar-Button-Rubbers... The Hole in the PCB where the LEDs shine thru, act as a Light-Shield... I too have to draw a RGB-LED board (for a other Task, to illuminate a Frontpanel...), since i dont have expierence with that RGB-LEDs... this will take a while... if you found a solution i would copy it from you.... At Kicad 7... didnt know there is a stable out... good to know... will update too (else i cant check your projects)
  14. yes i can share it... will take a while... do you want to use it in a button-led-matrix "scalar" way?
×
×
  • Create New...