|
I'm planning on making an iPod line-out / charging mount for my car, like a poster earlier in this thread. pinouts.ru has got me to the point where I know I can do the simple wiring involved, but then I discovered the Apple Accessory Protocol and my poor addled brain has started having Ideas. I would be tickled to build an iPod controller into my dashboard, but it occurred to me that I have no idea how to do serial communications on an embedded level. I'm used to memory mapped devices. "Write 0x1F230CD6 to memory location 0x0810," that sort of thing. I guess the actual hardware latches the value, maybe? I suppose having a Arduino-based solution would be the easiest on me so I don't have to build dedicated hardware, but that might be cool too. Any pointers on what I need to learn do to serial communications on this sort of level?
|
# ¿ Dec 25, 2008 20:37 |
|
|
# ¿ Apr 27, 2024 06:31 |
|
the wizards beard posted:I don't think you need to bother with AAP if you just want charging and line out. BattleMaster posted:You don't need to communicate with an iPod it to charge it or else MintyBoost wouldn't work. Well of course, that would be really stupid on Apple's part. Like I said I'm interested in building a controller. BattleMaster posted:(The Arduino is not a microcontroller, dammit!) quote:Using a UART is just like any memory-mapped peripheral, really. You toss the byte you want to send into a holding register and then watch a status register to find out when it's finished and ready to transmit another byte. Receiving is pretty much the same in reverse. If you're using C there's likely a ready-made library that does it all for you. Be sure to check the datasheet or manual for details. This gives me pause: http://arduino.cc/en/Reference/SoftwareSerial - it sounds like the API has some serious drawbacks. Would a different platform be a better way to go?
|
# ¿ Dec 26, 2008 05:15 |
|
Poopernickel posted:Because crimping ain't easy Well played
|
# ¿ Apr 17, 2009 15:14 |
|
catbread.jpg posted:I've got one tip with optimising bit operations: Are you seriously recommending something like this: code:
|
# ¿ Apr 30, 2009 20:16 |
|
catbread.jpg posted:No, I'm saying if you have seperate data bits originally (serial input or similar), AND you want to do bit operations on them before the final output, save the conversion to the bitfield till the end. You're going to have to give an example, because I'm still not seeing where you're going with your original claim. Why is it more "optimized" to change elements of an unsigned char[] (or whatever data width you're receiving) before packing them into a bitfield, rather than packing the input into a bitfield and performing bitwise operations? catbread.jpg posted:That second algorithm is doing unnecessary operations if bitfield is initialised to zero. I wrote that off the top of my head, it was meant for clarity rather than operation count. e: If you're receiving code:
csammis fucked around with this message at 22:31 on Apr 30, 2009 |
# ¿ Apr 30, 2009 22:21 |
|
catbread.jpg posted:Anything that involves getting or setting a bit value out of a byte is going to take more ops than doing boolean operations on bits represented with 0x01/0x00. Standard trade of time for space. Interesting. What processors do you work with that don't perform a bitwise operation (shift left/right, rotate left/right, AND, OR, NOT, XOR) in a single opcode, or in more opcodes than an ADD or SUB arithmetic operation?
|
# ¿ May 4, 2009 18:18 |
|
BattleMaster posted:The only other thing I can think of is that perhaps optimizations are disabled when you do a debug build. I don't know specifically about AVR compilers or what-have-you but this is almost always true. When a compiler generates a debug build, optimizations are turned off for the sake of the debugger. Optimizations reorganize code in a way that makes it difficult or impossible for a debugging session to follow the source code precisely.
|
# ¿ May 6, 2009 14:28 |
|
I've got an idea for home automation that involves having speakers and microphones in several rooms, each of which is tied to a central computer. A person could speak a command into a microphone and the computer would relay its response back to the speaker paired with the microphone. And I would like to do this wirelessly code:
Basically I don't know what's out there for a project like this. I'm much more in tune with the software side of my dumb ideas than the hardware. Please educate me
|
# ¿ Aug 7, 2009 01:19 |
|
I'm taking apart my old broken 3G iPod (bored) and thought it might be fun to play around with the click wheel component. Any chance that someone knows the pinouts for it, or could help me discover them? I've checked pinouts.ru with no luck.
|
# ¿ Oct 1, 2009 23:48 |
|
My electronics knowledge is basically non-existant (I'm a computer scientist by education) but I've picked up a couple of Launchpads with the abstract goal of learning more about microcontroller programming and the more concrete goal of setting up some discrete monitors of things around my house that can interface with a central server. As an example, I'm forever putting clothes in the dryer and then missing the buzz because it's rather far away from my office - I'd like to build a little module that will hook onto the buzzer and send a signal of some kind (wireless via an XBee? Haven't gotten that far) to my computer telling me to get off my rear end and fold things. In any case I'll probably be hitting up this thread for recommendations and advice from time to time. First up: could someone recommend a digital multimeter for around the $50 mark? I'm not sure what I should be looking for as far as a feature set goes. My uncle tried to get me into electronics when I was a kid and the multimeter I had then had such features as an analog dial which you calibrated by turning the big dial to RESISTANCE and touching the leads together, then fiddling a screw until the needle hit zero
|
# ¿ Apr 29, 2011 23:51 |
|
The following assumes that Whompy has a saltwater fishtank: 1) Calibration would be easy since RO/DI water should have a zero or near-zero total dissolved solids and be pretty deionized. 2) I don't think it's a good idea to put bare copper in the water (copper kills marine invertebrates). 3) Would another metal be sufficient for measuring resistance between two probes? Most metal motor axles for powerheads and such are titanium and even that corrodes eventually but it takes a lot longer. 4) I'm not sure what Whompy's setup is like or why he's testing for salinity in the first place but would specific gravity be a possible alternative measurement? I have zero idea if that can be measured electronically. I've only seen it measured optically with a refractometer and via buoyancy with those goofy swing-arm things.
|
# ¿ May 31, 2011 14:25 |
|
Delta-Wye posted:I've used IAR a bit (which is free) but I like crossstudio better (not free, as I recall). I can pm/email you one of my homework assignments from last year that uses a timer to generate an interrupt every 2 ms, has a code listing and a real quick study of power usage (actually, awake time vs. sleep time, but that's the idea). I'd be interested in that. I picked up a couple of Launchpads in order to teach myself uC programming but I'm a bit stuck on the "what the hell do I do with this" part. Looking at more projects might kick my butt in that direction
|
# ¿ Jun 15, 2011 22:35 |
|
It's not the easiest way but if you want to email me the file I'll host it on my site. I do this with a few other low-bandwidth goon files that I've got interest in c.sammis@gmail.com That or maybe Rapidshare? I don't know if that's even considered a legitimate thing to use for normal files and not just
|
# ¿ Jun 16, 2011 21:18 |
|
Delta-Wye's file "MSP430 example w/ interrupts, timers, and a code listing" is up at http://csammisrun.net/sa/CPEHW1.pdf
|
# ¿ Jun 16, 2011 22:07 |
|
On the subject of MSP430s and Launchpads: Delta-Wye inspired me to get off my butt and write my first program for the Launchpad. I spent last night hammering this out using msp430-gcc on my Macbook - no fine IDE for me so no debugger at the moment http://codepad.org/Suru41xw There's a problem with it that I'm hoping this thread can help me with (please keep in mind this is my very first shot at writing C for a microcontroller). The LED toggles on the first button press and then every third button press instead of every other. Basically this where the Xs are button presses: code:
So now I have myself a very nice waltz counter but that isn't what I was going for. Can anyone give me some pointers to ferret out what's wrong? I feel like maybe I'm not re-enabling an interrupt or clearing a flag where I should be. Update: Success! It turns out that I wasn't clearing the P1 interrupt flags at the end of the debounce timer ISR and that was causing some cruft to miss my case statement in the button ISR. I'm slightly confused as to why I have to clear the entire flag register as opposed to just resetting the single bit for the button. Couldn't that potentially axe a legitimate pending interrupt? Any insights? http://codepad.org/vQbhei0c csammis fucked around with this message at 23:06 on Jun 17, 2011 |
# ¿ Jun 17, 2011 17:50 |
|
I was thinking about getting a logic analyzer at some point to help me out with continuing adventures in embedded development and have found http://www.saleae.com/logic/. Does anyone in this thread have any experiences good or bad with it? My needs are not many at this stage - I would like to be able to see PWM output on something other than an LED and a guess at the percentage of brightness, for example.
|
# ¿ Jun 27, 2011 01:31 |
|
Slanderer posted:Never used it to measure PWM, though. Not sure why you would---LEDs are hilariously bad for trying to guess at the % with, since your visual response to the duty cycle is logarithmic. Huh, this actually explains quite a bit - I thought I was seeing progressively diminishing increases in brightness as duty cycle % increased but my eyes are not great in the first place. This is why it would be helpful for me, a complete beginner in electronics, to see charts of logic output over time instead of having to hope for the best and learn from offhand comments on forums that my "test" is fundamentally flawed
|
# ¿ Jun 27, 2011 03:09 |
|
Zaxxon posted:I'm a bit confused is there any reason you can't just use an Osciloscope? Yes; I don't have one. e: or have any idea where to get one, how to use one, what all good it would be over a logic analyzer, etc. If you can enlighten me I'm all ears.
|
# ¿ Jul 3, 2011 04:59 |
|
Out of curiosity I took apart one of those cheap solar LED lamps you'd find in garden supply stores and found a grand total of five components: a small NiCad battery, the solar panel, an 8kohm resistor, an LED, and a component I don't recognize. It looks like a transistor except it has four leads. My best guess is that it's responsible for turning off the LED when it is light out (when the solar panel is emitting energy) and maybe for charging the battery from the panel? It's stamped like this:code:
|
# ¿ Jul 9, 2011 21:49 |
|
Here's a crappy picture of the component:
|
# ¿ Jul 9, 2011 23:59 |
|
I'm looking to drive a 9V relay from the output of a MSP430G2xx pin that's running at 3 Vcc. Can someone point me to some reading material on how to boost the voltage from the pin? Should I isolate the relay from the microcontroller somehow? Thanks!
|
# ¿ Aug 22, 2011 22:21 |
|
The dev board is a Launchpad running off a USB line so it's not readily available...what if I had a power source running at 9V, how would I downconvert the voltage so that the uC has a 3V rail to work with?
|
# ¿ Aug 22, 2011 22:29 |
|
I'm designing an aquarium controller around an MSP430 and I'd like for it to have some sort of external time source that will let it turn lights on and off on a schedule. I suppose I could just use an RTC source but then I would have to include an interface to actually set the real time. I'd really prefer to use something like GPS that'll just give me a timestamp (though GPS signals don't include a date and that might be helpful). I started looking at small GPS receivers but this particular unit is very much overkill - pretty sure that my aquarium will neither accelerate nor unexpectedly change orientation with magnetic north - and I'm not really sure what all is out there as far as getting a timestamp over the air or where I can search for and find components. Can anyone recommend a simple GPS receiver, a component that can receive WWVB, or something similar? Generally speaking the smaller and easier-to-interface the better; the MSP430 value line isn't suffering from a surplus of memory or IO pins
|
# ¿ Oct 23, 2011 04:16 |
|
Corla Plankun posted:If you don't want to include an interface to set the time, how are people going to set the times the lights will turn on and off? That is a good point but this is a build for myself. I am going to program the hour ranges into the chip and if I ever need to change them then it's a quick trip to the Launchpad and back to work. Delta Wye posted:http://www.sparkfun.com/products/10060 is what you want, but both SFE and digi-key are out of stock Why yes that is exactly what I want! I'm in no particular hurry so I guess I can wait until they're stocked someplace again...unless not available for backorder means they're not being made anymore or something? Sandbox posted:Another option that may work is this little wifi module, again from sparkfun: I thought about something like this but having to implement an NTP client alongside the rest of the controller code makes me balk a bit (2k code size). It'd be fun to try though
|
# ¿ Oct 23, 2011 16:50 |
|
Delta-Wye posted:Uh, this PWM business is news to me. What is the PWM controller for? Brightness control? What kind of PWM controller? Part #, etc, etc. I have no idea what Hidden Under A Hat is doing but I've read that some current drivers from ledsupply provide a digital PWM input to supplement / replace the potentiometer (I haven't looked deeply into it). Aquarium hobbyists tend to use these to automatically simulate a sunrise or sunset with their LED arrays, typically providing the PWM from an Arduino
|
# ¿ Nov 30, 2011 21:39 |
|
I'd like to learn to use the freeware version of EAGLE (on OS X) to draw out schematics and layouts but holy mother of god it is non-intuitive and clunky. Maybe it's because I don't have any EE or circuit design training but I feel like I'm fighting to draw even a simple schematic. I have no idea what to do if I want to add something to my schematic if that component doesn't exist in the library (or any I can find). Is there a good series of tutorials I can read or watch on the subject?
|
# ¿ Dec 30, 2011 20:26 |
|
I use MacVIM + mspgcc on Lion exclusively for Launchpad development. It works really well and if you're already familiar with the GCC toolchain and comfortable debugging with GDB it'll be right up your alley
|
# ¿ May 12, 2012 04:25 |
|
I'm going to be moving to a new desk in my company's office that is in something of a blind corner. I'd like my teams to be able to see if I'm at my desk without having to walk a maze so I'm thinking about a way of broadcasting my presence if I'm in the area. My first idea was having a light perched on the top of my cube. The light would be connected to a Bluetooth module paired to my iPhone so that if I come within range of it, light goes on. It's the same idea as BlueProximity only with discrete components instead of a PC doing the work. My basic problem is that I've never worked with any sort of component more complicated than a Nokia LCD and I don't know if what I'm thinking about is possible for an amateur. I'm fairly comfortable with the MSP430 value line (Launchpad) microcontrollers - that particular uC might not have the stones to connect to a Bluetooth device but I could probably source one that does with a little pointing in the right direction. I have one fundamental question before I begin asking more: Is this even going to be possible, specifically with the iPhone? I was doing some initial reading on Sparkfun and in the comments on this module and apparently there's some authentication chip that Apple requires to pair with an iOS device - except possibly for HID devices? Could I get a module configured for HID and rig that somehow?
|
# ¿ May 20, 2012 04:12 |
|
This is probably a seriously stupid question but it goes to show how much I don't remember from college electromagnetics I'm working with an MSP430 chip that is delivering 3.3V on its IO pins. I'm looking to do something with sound and my first thought is PWM with a piezo buzzer. While I was looking around for resources I came across this little speaker: http://www.pololu.com/catalog/product/1261/resources quote:This automotive-quality 0.15W speaker is a compact way to add sound to your project. The 100Ω impedance makes it easy to drive this straight from a microcontroller I/O pin. I'm not quite sure if I know what the bolded part means. Here's my stab at it: I know V = IR and according to the Wikipedia page on impedance V = IZ too. Since VCC in my application is 3.3V and the impedance is 100ohms I think that means that the speaker would only draw 33 milliamps. Is that correct? Is that what they mean when the description says it's easy to drive from a microcontroller pin? Where does the 0.15W come into play here?
|
# ¿ Nov 6, 2012 05:28 |
|
Thanks for confirming my math was right! Moving right along, looking up how much the MSP430G2231 (the older Launchpad chip) could source leads me to another question. According to the datasheet if I did pull 33mA from one of the output pins then I would see somewhere between a 1V and 1.5V drop in the output voltage. Okay, I didn't realize that voltage drop would occur but I accept that this is a thing that happens...but then, wouldn't the lower voltage mean that the current consumption is lower too? 2V/100ohm = 22mA which would mean less voltage drop so the current consumption would go up and oh gently caress I'm lost again
|
# ¿ Nov 6, 2012 06:07 |
|
Bad Munki posted:The only problem with that is that I think it might be too large. The reservoir this thing is in isn't very deep, and if it needs, say, 3" to work in, I'm not sure that'll work. I use these switches for aquarium level sensing and they definitely don't require three inches to work. Fill the water to where you want the LOW level to be, run a battery and an LED through the switch, and mount it exactly at the point where the LED goes on (or off depending on how you have the switch set up). Then fill up the reservoir and you're good to go. They're fairly sensitive little guys.
|
# ¿ Dec 10, 2012 20:31 |
|
Terminal Entropy posted:You could look at workstations that Dremel has: http://www.dremel.com/en-us/attachments/Pages/ProductDetail.aspx?pid=220-01 I have one of these and it's very useful for drilling tiny holes that I'm not comfortable doing freehand (PCBs and acrylic mostly).
|
# ¿ Mar 5, 2013 18:23 |
|
I've accomplished the exact same thing with a Launchpad, albeit the G2231 chip. Code's on my Github and here:code:
edit: my code's a bit old but I did notice that you're using "CCR1," "CCTL1" instead of specifying TACCR1 or TBCCR1 to specify which timer you're using...is that correct? Do you get better results when you specify the registers for the timer you're using (A probably)? csammis fucked around with this message at 00:50 on Jun 9, 2013 |
# ¿ Jun 9, 2013 00:44 |
|
Kire posted:I tried using your debounce.h but it doesn't work with my G2553. Are you using G2231 specific code? What does "doesn't work" mean? Doesn't function, or doesn't compile? If you look at the Github README you'll see that I'm using a gcc toolchain and you're using CCS. Depending on how you define DEBOUNCE_USING_ then you'll either get gcc-specific inline assembly or a (probably) gcc-specific interrupt declaration syntax. What's the exact problem you're seeing? quote:Without debouncing, I set a watch point for the PWM_select variable in my code, and once I push the launchpad's button PWM_select counts up continuously and doesn't stop. It's as if the button bounces for several minutes afterwards. This only happens after I run and restart the code once or twice. Maybe you're seeing floating inputs on the other Port 1 pins that are causing the interrupt handler to be called over and over? Try checking to make sure that the specific interrupt flag that you're looking for is set before you run your code using if (P1IFG & BIT4) { /* your-code */ } Are you trying to use P1.3 or P1.4 for your button input, by the way? Your code says P1.4 (because you're masking with BIT4) but your comments say P1.3. Edit: Definitely check this. Your main method says "Configure input on the switch" using P1.3, does that, and then goes on to set up interrupts on P1.4 which you're clearing in the interrupt handler but you're never checking for P1.3 and clearing that. Go back and double-check your switch connections and read through the code to make sure you've written what you want it to do. csammis fucked around with this message at 19:13 on Jun 9, 2013 |
# ¿ Jun 9, 2013 18:59 |
|
Kire posted:Ah, that fixed it, thanks- you were right, using BIT4 was incorrect. Glad you got it working I'm guessing the compile error "PWM_select is undefined" has to do with the compile error in debounce.h - the compiler gets "confused" because it can't determine what wdt_isr is supposed to be. I said that the syntax on the ISR declaration was probably gcc specific. Change interrupt(WDT_VECTOR) wdt_isr() (the GCC syntax) to the syntax you're already using for the Port1 ISR: code:
|
# ¿ Jun 10, 2013 13:09 |
|
Slanderer posted:Float switches are probably the best bet. They are reliable and don't need complex calibration. This application doesn't actually need to sense the water level, just turn on the pump if there is enough water present. I use float switches in my aquarium's sump for topoff control and they're usually great. The only issue with float switches is the possibility that whatever gunk is accumulating on the existing solution could also gunk up the float switch and cause it to stick, which depending on how it's wired would either end up pumping dry or not pumping at all. If you'd be worried about that then consider using multiple float switches to control failsafes. I have one float switch in my sump to activate a pump which adds freshwater from a reservoir and a second switch in the reservoir that prevents the pump from activating if it's empty. An additional level of safety would be a "high mark" switch in the sump to stop the pump in case the main one gets stuck on but in my case that's not an issue (the controller shuts off the pump after 10 minutes of continuous operation).
|
# ¿ Nov 18, 2015 19:52 |
|
Fat Turkey posted:I'm not sure about these aquarium feeders but from the sound of it its wet food? This would be for the main diet of fresh fruit and veg, so solids. Aquarium feeders are for dry food, flake or pellet, and are intended to hold many days worth of food. Fresh fruit and vegetables would be a really bad idea for one of these. You want something that'd be easy to clean and store no more than a day's worth of food at a time.
|
# ¿ Jan 31, 2016 22:42 |
|
Brekelefuw posted:This is not going to be used with water. I am building a machine that tests for leaks, and uses an aquarium pump to generate air pressure to find the leaks. I'm not sure that a cheapo aquarium air pump that's "rated for 10 gallon tanks" is going to be able to pressurize very much. The reason for that rating is because it isn't able to effectively push air down through more than 12" (the height of a 10 gallon tank) of water pressure, which at sea level is something like 0.4 PSI, and those pumps don't handle backpressure well in my experience. Now all that said I know some stuff about aquarium equipment and its limits but I've never tried to pressurize a vessel with one of those. I'm not saying it can't be done but you may want to do some tests with your specific pump before going to the trouble of cutting wires and such.
|
# ¿ Nov 2, 2016 18:18 |
|
Sockser posted:e: Thinking about it now, having made this post, I guess my real problem is I'd want a sorta cloudy ball, rather than this perfectly clear guy I've got going on. Anyone got a good source for mostly-transparent acrylic balls on the cheap? If you want it looking frosted as opposed to "swirling patterns shot through the ball"-style cloudy and the ball is acrylic, hit it with some very fine sandpaper, like 2000 grit. That should give the surface a frosted look and diffuse any light going through it fairly well.
|
# ¿ Mar 10, 2017 15:01 |
|
|
# ¿ Apr 27, 2024 06:31 |
|
Nice! Glad the sanding worked
|
# ¿ Mar 10, 2017 20:47 |