Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Victor
Jun 18, 2004

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.

Yeah it's cool for stuff to run on other OSes, but to be honest, I'd rather the companies continue to invest their time and money into improving and perfecting their tools for one OS. They cater to corporations, not hobbyists, and for the most part it's Windows workstations with perhaps some Linux servers doing X11 forwarding for some high-end Cadence/Mentor simulation packages.
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.

Adbot
ADBOT LOVES YOU

The Gripper
Sep 14, 2004
i am winner

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 :effort:
I'm not sure about Teensy, but the Uno I have on my desk struggles operating a solo ES08A servo with either USB or wall-socket supply (this model comes packaged into a lot of beginner kits). Tell-tale endless sweeping and/or sweep to it's max range (and further, if it could), a lot of beginners assume busted servo/bad wiring/"something is broken!" when it's generally the servo drawing more current than the supply can handle.

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

some kinda jackal
Feb 25, 2003

 
 
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 :)

Dolex
May 5, 2001

Victor posted:

Retina MBP.
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.

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.

movax
Aug 30, 2008

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.

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.

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 :pcgaming: 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.

Victor
Jun 18, 2004

movax posted:

I'm not sure what you mean about package management though?
I can do sudo port install mmv to get the multiple-file renaming tool called mmv. So if someone tells me about mmv, I can have the installation process started in seconds. I don't have to navigate to a website, find the downloads page, find the right one for my OS, download it, run it, click through a EULA, etc. Uninstalling it is as simple as sudo port uninstall mvv. Oh, and package managers take care of dependencies.

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 think Atmel is trying to get people away from the ATmega series, though. For example, the ATmega2560 is ($17.97, $10.03) from digikey, while the STM42F407 is ($12.78, $9.88, $6.97) from digikey (qty 1, qty 100, qty 10,000). The former is an 8-bit 16MHz chip with 8K SRAM and no FPU, while the latter is a 32-bit 168MHz ARM with 196K SRAM, FPU, USB, Ethernet, RTC, DMA, SDIO, up to 17 timers, etc. Hmmm, perhaps a better comparison would be to Atmel's ATSAM3X8CA-AU, which is ($10.92, $6.10) from digikey. 32-bit, 84 MHz, no FPU still, but Ethernet, USB, 96K SRAM, etc.

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.

some kinda jackal
Feb 25, 2003

 
 
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

some kinda jackal
Feb 25, 2003

 
 
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.

robostac
Sep 23, 2009
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.

some kinda jackal
Feb 25, 2003

 
 
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.

some kinda jackal
Feb 25, 2003

 
 
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 :laffo:

some kinda jackal fucked around with this message at 06:57 on Nov 24, 2012

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

I meant to post this here originally, but did the wrong thread on accident, so quoting myself

peepsalot 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

Ubuntu has all the msp430 gcc, debug, etc. packages available in repository

Then use this example project:
https://github.com/zacwheeler/had_launchpad-blink
There are other variations of the same blink code that I tried before that which were just outdated i guess because the compile kept failing.

The readme for that github has very straightforward steps to make it work.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

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?

Base Emitter
Apr 1, 2012

?

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'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?

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).

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

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.

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).
Yeah i've just got the two chips that came with my Launchpad which are MSP430G2553 and MSP430G2452. Unfortunately as far as I can tell they don't have hardware multipliers. I think mostly just the MSP430F... versions have them. Man, I really had no idea how many freaking variations of this chip there were until I looked at the product selector. 380! I thought it was just a few different in flash and RAM capacities and packages.

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

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
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!

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

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!
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. I'm still looking into how all the PWM stuff works at the moment. I don't anticipate square, triangle, and saw would be very difficult to generate on the fly. I was wondering if there is maybe some other things that would be done to make it sound like a guitar pluck though.

Also bass kick, hi-hat, etc.

peepsalot fucked around with this message at 22:03 on Nov 24, 2012

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

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.

Base Emitter
Apr 1, 2012

?

PDP-1 posted:

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.

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.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

PDP-1 posted:

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.
I never could really wrap my head around FFT and iFFT, but assuming I ever understood it do you really think a 16bit mcu with no hardware multiplier could even manage anything like that?

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
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.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

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

some kinda jackal
Feb 25, 2003

 
 
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.

movax
Aug 30, 2008

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.

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.

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.

some kinda jackal
Feb 25, 2003

 
 
Yeah I'm looking for the trickery to accomplish the latter so the entire bus is 4 lines regardless of the number of devices :3:

Obviously I could use I2C at this stage, but I'm curious :haw:

robostac
Sep 23, 2009
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.

Victor
Jun 18, 2004
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.

some kinda jackal
Feb 25, 2003

 
 
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

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

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.

Arcsech
Aug 5, 2008

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.

Victor
Jun 18, 2004
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.

KaiserBen
Aug 11, 2007

Martytoof posted:

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.

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.

armorer
Aug 6, 2012

I like metal.

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.

Krenzo
Nov 10, 2004
I got my Stellaris several weeks ago.

YO MAMA HEAD
Sep 11, 2007

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!

some kinda jackal
Feb 25, 2003

 
 

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.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
Any decent profilers for ARM that I could interact with via JTAG or SWD?

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
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.

movax
Aug 30, 2008

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.

Adbot
ADBOT LOVES YOU

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

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:

—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!
I'm trying to do a similar thing on msp430. I think the big thing is to filter and amp your output, which i'm still trying to figure out.

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

  • Locked thread