|
movax posted:There's no nerdcred to it, I use Windows for everything because the manufacturers support it, I've been using it for probably 15 years now, and oh yeah, I pretty much never have to gently caress with anything to get a toolchain up and running.
|
# ? Nov 13, 2012 20:47 |
|
|
# ? May 10, 2024 01:04 |
|
Vlad the Retailer posted:Alternatively, you could make a pan/tilt rig for a laser pointer (or really small camera) with two servos. If you're lucky, you might be able to power both of them with the micro's current source for less wiring If you're going to play around with servos I'd recommend always working with the assumption that you'll power your servos separately, and only scale back to board power if you're using servos you *know* will work with it. Also, I bought some loose components from Farnell/Element14 (Australia) a while ago and they've literally been showering me with free poo poo and discounts ever since. I mean I bought maybe 5000 resistors (accidentally, units were in lots of 10) and ~100 shift registers/transistor arrays, nothing too serious or large enough to look like I'm a big player or anything. Probably $30 worth of components, all up. They're even comping me delivery from the UK on small batches of components that aren't in stock, as long as they fit in a shipping envelope. It's the best thing. The Gripper fucked around with this message at 03:14 on Nov 14, 2012 |
# ? Nov 14, 2012 01:55 |
|
Newark (el14) is awesome. Our university has a purchase program with them and I will just throw random little things I want to tinker with on bulk purchase orders. They give us next-day delivery too. I love dealing with them
|
# ? Nov 14, 2012 04:49 |
|
Victor posted:Retina MBP. Also, when OpenCL was "first released" it was nearly impossible to get an NVidia card properly configured in Linux to work with it, so I had a windows box to learn OpenCL development on.
|
# ? Nov 14, 2012 15:23 |
|
Victor posted:I have two objections, one of which is somewhat alleviated by PowerShell: the Windows shell sucks. Some things fit IDEs well, but some things really just don't. Second: package manager? Hello? Note that I used 100% Windows up until two years ago; I first transitioned to OSX because of work, then treated myself to a Retina MBP. Agreed on the first one, the shell is definitely subpar compared to Linux/OS X; there's a project on Kickstarter that looks promising at least, and promises to work with cygwin, so at least git might become less painful to use for me at some point. I'm not sure what you mean about package management though? Dolex posted:Windows (for *all* of its faults) is really great about having turnkey solutions to new technology. Getting certain MSKinect toolkits to compile/install in linux is a complete nightmare. In windows there are three .MSI files to click and we're running. I have a dedicated windows laptop as my Kinect manager for my projector installations. Well to be fair, of course Windows would be the primary focus for Kinect development seeing as it's coming from Microsoft, and I'm sure the existing Xbox 360 SDK had something to do with it as well. The Nvidia thing is a bit weird to me though (I do a lot of CUDA stuff); on one hand, Windows obviously enjoys a huge amount of software development resources thanks to and workstation apps, but on the other hand, the supercomputers stuffed full of Teslas for GPGPU work are all running flavors of Linux, so you'd think they'd get some early loving as well. To remain tangentially on topic though, it seems like AVR enjoys a large amount of cross-platform support, and a vast amount of that is open-source or at least free. Microchip's now cross-platform, but it's all closed-source and proprietary from Microchip (which I'm cool with, but others may not be). Seems like ARM varies based on the specific implementation though.
|
# ? Nov 14, 2012 16:19 |
|
movax posted:I'm not sure what you mean about package management though? movax posted:To remain tangentially on topic though, it seems like AVR enjoys a large amount of cross-platform support, and a vast amount of that is open-source or at least free. Microchip's now cross-platform, but it's all closed-source and proprietary from Microchip (which I'm cool with, but others may not be). Seems like ARM varies based on the specific implementation though. I don't really feel like looking for competitors to Atmel's smaller chips, like the ATmega8A. Well, maybe not. The cheapest XMega is ($2.39, $1.33) from digikey while the cheapest ATmega8A is ($3.21, $1.79) from digikey. I'm pretty sure that XMega is better than the ATmega8A in pretty much every way, except that it has 44 pins instead of 32.
|
# ? Nov 14, 2012 18:47 |
|
Yeah, Code Red actually has Red Suite 5 available for Linux and MacOS hosts with an available demo. I'm going to give it a shot when my Stelarri arrive, even though I decided to stick to Keil in a VM for now. Mainly because there's probably no way I could justify buying it as a hobbyist. edit: Ugh, Newark just pushed availability of the TI Stellaris back another month. Is TI not making these in volume or what? some kinda jackal fucked around with this message at 20:44 on Nov 17, 2012 |
# ? Nov 15, 2012 03:57 |
|
What do you guys think about Cortex programming using CMSIS versus device specific libraries? StellarisWare is actually really awesome, but I like the idea that I can take my code from my STM32F3 board to a TI board if I want. I mean I think I know what I'll end up doing, just wondering what everyone else does.
|
# ? Nov 18, 2012 21:50 |
|
As far as I'm aware CMSIS doesn't really make that possible. It provides interfaces to the common cortex functionality (interrupts, debug, systick, base clocks), but any extra peripherals are completely different. The STM libraries extend CMSIS to give you access to the STM peripherals, but you couldn't switch to another manufacturers chip without rewriting all your peripheral code (or even switch between some STM families - the STM32F2 library is quite different to the STM32F1 library). This seems to be an issue with all arm chips. While the core is identical (so in theory code written for one cortex device should run on any cortex device), there aren't standards for peripherals, so every chip has to have it's own device libraries.
|
# ? Nov 19, 2012 11:30 |
|
Oh hmm. My understanding was that CMSIS gave you the basics cortex functionality and then the vendor provided a CMSIS templated peripheral header so while you couldn't use the STM provided header on an NXP chip, you could just go to NXP, download their chip's header and recompile your code (for the most part) to run on the NXP platform. It's so hard to find any in-depth information on CMSIS.
|
# ? Nov 19, 2012 17:11 |
|
Hurray, doublepost! Turns out that CMSIS isn't that difficult, it's just kind of esoteric compared to using vendor libraries. NXP has a lot of great examples, and I ended up buying an lpcxpresso board to tool around with. So far it looks like you're right though. The base Cortex registers are interchangeable because it's including a common CMSIS header, but vendor peripherals can still be declared to basically whatever the vendor chooses, so there's no guarantee that UART0 will be UART0 when moving from TI to NXP for example. Seems like a good halfway solution is to come up with your own header file which defines a set of standard peripherals against the vendors' names and then just use your definitions in the code. That way you can always refer to (your) MCU_I2C0 and not have to worry about whether it's LPC_I2C0 or I2C0 or ATMEL_I2C0 Of course I could just be talking out my rear end. I've done all this reading but I still haven't actually put bit to screen yet and done a single custom app. I'll be trying soon though. I'm really guilty of "read everything you can before you start" instead of "read enough poo poo and then go play/discover on your own". On that note, does anyone know where/if I can get a printed or bound copy of an NXP mcu manual? Specifically: http://www.nxp.com/documents/user_manual/UM10360.pdf If I can't find anything online I'll end up just taking it to Staples and having them print and bind the PDF, but I didn't know if there was some place that actually sold these sorts of things in book format. PDFs are great, but there really is no substitute for being able to thumb through a printed book to reference something. Scribble notes, highlight stuff, mark important pages. e: Staples wants $300 to print some kinda jackal fucked around with this message at 06:57 on Nov 24, 2012 |
# ? Nov 23, 2012 17:37 |
|
I meant to post this here originally, but did the wrong thread on accident, so quoting myselfpeepsalot posted:I had a hell of a time figuring out how to get started with MSP430 Launchpad, but after a couple hours of trying various outdated guides, I finally compiled and loaded a LED blink demo using msp430-gcc. So in case anyone else wants to know how to get from 0 to blinkenlights
|
# ? Nov 24, 2012 05:25 |
|
OK, so my idea for now is to play around with audio on this msp430 and see how nice of a song i can cram into 16KB. I know i could implement some external storage, but I'm just more interested in testing the limits of what i can do with this chip and not wanting to order more ICs at the moment. I'd like to be able to mix a few channels to play multiple simultaneous notes. I'm just wondering if anyone has suggestions/tip/tricks to do mixing and sequencing on limited cpu like this. This is maybe getting more into general programming and algorithms, but I'm wondering if there are resources for simple models of common instruments, like procedurally generated waveforms that might sound like a guitar string, etc. Also does any kind of demoscene exist for microcontroller stuff like this?
|
# ? Nov 24, 2012 08:17 |
|
peepsalot posted:OK, so my idea for now is to play around with audio on this msp430 and see how nice of a song i can cram into 16KB. I know i could implement some external storage, but I'm just more interested in testing the limits of what i can do with this chip and not wanting to order more ICs at the moment. I'm not super familiar with the msp430, but it does have some nice stuff on it for audio, depending on which variation you've got. Pretty much any microcontroller can do chiptune style stuff. With a 16-bit CPU and a 12-bit DAC (or a delta-sigma DAC) you can do basic sample (looped or one-shot) playback pretty easily, though your sample sizes are limited by available memory. Beyond that there's tons of DSP type techniques, particularly if you are using a CPU with a hardware multiplier on it. That's rather a broad subject, but if you're going to do sample playback, you can add envelopes and modulation. There's lots more you can do... I currently have a half-finished project to do some digital string simulation (a very basic physical model) in an mbed (an ARM board).
|
# ? Nov 24, 2012 08:55 |
|
Base Emitter posted:I'm not super familiar with the msp430, but it does have some nice stuff on it for audio, depending on which variation you've got. So yeah without hardware multiplier I think i'll have to be pretty careful about minimizing calculations. I found a PDF from TI explaining a couple efficient mult/div algorithms which can be implemented on MSP430, so that's nice. http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slaa329&docCategoryId=1&familyId=911
|
# ? Nov 24, 2012 19:42 |
|
How about write a polyphonic waveform generator using PWM. Square waves are easy, and you can approximate triangle, sawtooth and sine pretty efficiently using Bresenham line/circle algorithms. I've been planning to do something like this for a while but you could probably beat me to it!
|
# ? Nov 24, 2012 20:13 |
|
Silver Alicorn posted:How about write a polyphonic waveform generator using PWM. Square waves are easy, and you can approximate triangle, sawtooth and sine pretty efficiently using Bresenham line/circle algorithms. I've been planning to do something like this for a while but you could probably beat me to it! Also bass kick, hi-hat, etc. peepsalot fucked around with this message at 22:03 on Nov 24, 2012 |
# ? Nov 24, 2012 21:56 |
|
peepsalot posted:Yeah i was thinking maybe storing a hardcoded lookup table of a quarter of a sine wave and flipping it around the different ways to get the full wave. The CORDIC algorithm might be helpful for generating sine waves without a hardware multiplier. One way I can think of offhand to do instrument sounds would be to record a short (0.1 second-ish) snippet of that instrument playing a sustained note, and then play that snippet back at a faster or slower rate. Digitize the sound, then FFT and un-FFT it to get a symmetric sample that won't blip when it repeats. A less satisfactory way may be to try to figure out a harmonic profile for the instrument you want to replicate - i.e. a piano might have a fundamental tone with amplitude 1.0, a second harmonic with amplitude 0.5, third harmonic at amplitude 0.1, etc., and so you generate those harmonics and blend them together with appropriate relative weighting. Then you'd change the harmonic weightings to get 'flute' or 'tuba' sounds.
|
# ? Nov 24, 2012 23:28 |
|
PDP-1 posted:The CORDIC algorithm might be helpful for generating sine waves without a hardware multiplier. I wouldn't invest too much time in sine waves if you're interested in musically interesting sounds rather than the programming exercise. Sine waves are boring, and you will almost always prefer square, triangle, or sawtooth signals when you're making sounds, and you can generate all of them with a simple counter. Modulation is where things get interesting. Build an envelope (ADSR) and an LFO and goof around with AM and FM modulating whatever oscillator (whether its a simple wave or a wavetable). Modulation will take some multiplying but hopefully not so much that you'll miss the hardware multiplier.
|
# ? Nov 24, 2012 23:54 |
|
PDP-1 posted:The CORDIC algorithm might be helpful for generating sine waves without a hardware multiplier.
|
# ? Nov 25, 2012 00:15 |
|
You'd do the FFT/iFFT in a pre-compute step on a normal computer, then download the result into whatever memory was on your board and play it back faster or slower to pitch shift. The purpose of the FFT stuff is to make sure that if you have a sample length of T seconds all the harmonics in the sound have periods that fit into T seconds in integer multiples so you have a minimal 'skip' when the sample repeats. The FFT stuff may well be overkill though, and best left to a later polishing stage. Maybe just try getting a 4kb sample to play in a loop at variable speed and worry about making it sound pretty later.
|
# ? Nov 25, 2012 01:09 |
|
Regarding general PWM audio generation, I'm trying to work out what sample rate and bit depth I should use. If my clock rate is 16Mhz and I have a 16bit timer to work with, say for example I wanted to try 16bit audio, i would have to use the full length of the timer for my PWM to get the full 65536 possible values out of it. So I would only be capable of 16000000/65536 ~= 244 samples/sec which is not fast enough for audio. So the best compromise I think would be 10bit audio, which would get me 15625 samples/sec and give me up to 1024 cycles to calculate my next sample. Does this make sense? Or is there some other weird old trick i'm not realizing that would let me get higher resolution than that at the same sample rate? This is assuming no external DACs or other ICs. Also, I guess I need to put a low pass filter this to smooth the PWM pulses. I have a small 16 ohm speaker that I plan on using. I don't know what the inductance is, so is it reasonable to model this as just RC filter for a ballpark figure? Using RC equation for cutoff freq Fc = 1/(2piRC), say i want to set it at 10Khz, then the C conveniently comes out to nearly exactly 1uF. Is adding inductance of the coil going to throw this off a ton? Edit: on second thought i'm not sure this makes any sense at all to use the load resistance as the filter resistor. My speaker looks a lot like this guys: https://www.youtube.com/watch?v=5A3bBXRpYCI I think he's using PWM to generate the audio square wave directly, whereas I want to use a much higher PWM to generate individual samples. Anyways, he has no limiting resistor or anything, is this possibly bad for the pins to provide this much current? Do they have some internal protection against shorts? peepsalot fucked around with this message at 03:11 on Nov 25, 2012 |
# ? Nov 25, 2012 02:03 |
|
Does anyone have a good primer for multiplexing SPI slave select pins? By which I mean using one pin for multiple slave select signals, as I understand is possible. I'm not really sure what this entails and I'm getting some muddled results googling, though I could just be plugging in the wrong terminology.
|
# ? Nov 25, 2012 23:06 |
|
Martytoof posted:Does anyone have a good primer for multiplexing SPI slave select pins? By which I mean using one pin for multiple slave select signals, as I understand is possible. Maybe you've swapped the pin name; you can (within reason) share/multiplex the data and clock lines, and have one SS line per space device. If you really wanted to use a single pin to control multiple SS lines, you'd need say an inverter or some other trickery to share the line properly.
|
# ? Nov 26, 2012 16:18 |
|
Yeah I'm looking for the trickery to accomplish the latter so the entire bus is 4 lines regardless of the number of devices Obviously I could use I2C at this stage, but I'm curious
|
# ? Nov 26, 2012 16:23 |
|
I'm not aware of any way you could multiplex the slave select pin (beyond switching between two devices on a single pin and using an inverter for one). SPI works by having a single device active if it's select pin is low, and if two devices were active you'd just end up with corrupt data. Regarding CMSIS - even if you did make UART0 on one chip match UART0 on another, I'd expect the internal registers to be incompatible as well, so you end up needing to rewrite most of the peripheral code. I guess it wouldn't be hard to write some standard functions to do this for switching between specific boards, but it's something you'd have to write rather than being included as part of CMSIS.
|
# ? Nov 26, 2012 18:06 |
|
Within the last few months, I read that at least some SPI slaves rely on an SS pin transition. I haven't looked at the state machines in particular, though.
|
# ? Nov 26, 2012 18:58 |
|
Blast. I haven't considered that. Welp, I think I'm still going to try to go directly to registers rather than using device specific libraries, just for the learning experience. e: Re: robostac re: SPI: I'm imagining something like: integrating some other IC into the SPI mix which would have, say, five or six high pins, each connected to a separate SPI slave, then in my SPI communication routine I could feed the IC a command depending on which IC I wanted to talk to, and it would bring that particular slave low for communication. I'm just talking out my rear end though. some kinda jackal fucked around with this message at 19:02 on Nov 26, 2012 |
# ? Nov 26, 2012 18:59 |
|
Martytoof posted:re: SPI: I'm imagining something like: integrating some other IC into the SPI mix which would have, say, five or six high pins, each connected to a separate SPI slave, then in my SPI communication routine I could feed the IC a command depending on which IC I wanted to talk to, and it would bring that particular slave low for communication. I'm just talking out my rear end though. Sounds like you are asking for a latching shift register.
|
# ? Nov 26, 2012 19:22 |
|
Martytoof posted:re: SPI: I'm imagining something like: integrating some other IC into the SPI mix which would have, say, five or six high pins, each connected to a separate SPI slave, then in my SPI communication routine I could feed the IC a command depending on which IC I wanted to talk to, and it would bring that particular slave low for communication. I'm just talking out my rear end though. It would require 6 total pins and you'd toggle other other ICs for a short time in the process (I'm not familiar enough with SPI to say whether that would break anything or not), but it seems like you could do this with a serial-in parallel-out shift register.
|
# ? Nov 26, 2012 19:24 |
|
Martytoof, you might look for an SPI device that demuxes the last 8-bit (well, 2–4-bit) value it received onto 4-16 pins, making them the inverse of SS. Surely something like this exists, for pin-starved MPU designs.
|
# ? Nov 26, 2012 19:38 |
|
Martytoof posted:Blast. I haven't considered that. http://ww1.microchip.com/downloads/en/devicedoc/21952b.pdf It's a lot more than you need, 16 IO pins, 2 interrupts, etc, but it'd allow you to do what you're looking to do.
|
# ? Nov 26, 2012 19:56 |
|
Martytoof posted:Did anyone who ordered that Stellaris Launchpad board for five bucks apiece get their order? Reaching back a ways here, but I just got mine via FedEx today. I put the order for 2 in on Sept 27th. So I'd say that they will ship them to you eventually - that Dec 17th date may be legit.
|
# ? Nov 28, 2012 03:05 |
|
I got my Stellaris several weeks ago.
|
# ? Nov 28, 2012 05:44 |
|
Does anyone here have any advice for working with PWM audio on the Arduino Uno? I'm trying to make an algorithmic synthesizer (a la http://countercomplex.blogspot.com/2011/10/some-deep-analysis-of-one-line-music.html) and have gotten past the ugly problems of on-the-fly string evaluation and getting sound to come out of the dang thing. I'm having two main problems: —What values should I be throwing this thing? The details of the ugly register construction is well beyond my experience level. Pages like http://arduino.cc/playground/Code/PCMAudio seem to suggest it's an unsigned byte, but I only get low rumbly squelches unless I shift my values left a few times. —Is there any reason the speed would be wobbling from its supposed 8000hz clock? I don't know enough to tell if this is a consequence of the affordable hardware or my laughably bad attempts at memory management. I will pastebin code if necessary, but I imagine these questions can be answered more generally. Thanks!
|
# ? Nov 28, 2012 05:59 |
|
armorer posted:Reaching back a ways here, but I just got mine via FedEx today. I put the order for 2 in on Sept 27th. So I'd say that they will ship them to you eventually - that Dec 17th date may be legit. Mine are going to be a nice surprise when they show up. I've since picked up an STM32F3Discovery and an LPCXpresso 1769. Honestly if I hadn't already paid for them I think I'd probably cancel the order at this point. Just more toys when they show up though.
|
# ? Nov 28, 2012 07:12 |
|
Any decent profilers for ARM that I could interact with via JTAG or SWD?
|
# ? Nov 29, 2012 15:47 |
|
Has anyone had any success with the USARTs on the STM32F05xxx? I'm trying to use my LaunchPad as a passthrough to USB, but I'm not sure if it's working or not. The TX pin will light up an LED when it's active, but connecting through puTTY doesn't show my test sequence. Don't know if it's the STM32 or the LaunchPad. Maybe I'll just get one of those USB<->UART cables that are $3 on eBay.
|
# ? Nov 30, 2012 04:31 |
|
Silver Alicorn posted:Has anyone had any success with the USARTs on the STM32F05xxx? I'm trying to use my LaunchPad as a passthrough to USB, but I'm not sure if it's working or not. The TX pin will light up an LED when it's active, but connecting through puTTY doesn't show my test sequence. Don't know if it's the STM32 or the LaunchPad. Maybe I'll just get one of those USB<->UART cables that are $3 on eBay. Do you have Tx->Rx set up properly? Should be crossed over, double-check the pin-names vs. what they actually are. Some people label their pins Tx and it's actually a receiver buffer where you hook up the external Rx line to it. After we made a mistake at work swapping some PCIe lanes around in the same way, we instituted a policy where all parts with transmitters/receivers have the buffers drawn on the symbol to prevent any confusion with regard to pin names.
|
# ? Nov 30, 2012 07:18 |
|
|
# ? May 10, 2024 01:04 |
|
YO MAMA HEAD posted:Does anyone here have any advice for working with PWM audio on the Arduino Uno? I'm trying to make an algorithmic synthesizer (a la http://countercomplex.blogspot.com/2011/10/some-deep-analysis-of-one-line-music.html) and have gotten past the ugly problems of on-the-fly string evaluation and getting sound to come out of the dang thing. I'm having two main problems: I just followed this guy's schematic (using different RC components for higher cutoff) using dual OPA376 opamps (OPA2376 for dual package), stupidly assuming they could power a speaker without looking at the datasheet, but now that i've built, i realized i still need an amp. So I guess I'm ordering lm386 to attach to that output. And then hopefully it will drive this dumb 16 ohm speaker i have. edit: here's my ridiculous opamp filter circuit thing. couldn't get 2376 in dip package. peepsalot fucked around with this message at 08:02 on Nov 30, 2012 |
# ? Nov 30, 2012 07:32 |