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.
 
  • Post
  • Reply
BattleMaster
Aug 14, 2000

SnoPuppy posted:

All I meant is that straight C is pretty low level. There are very few things that you could do that wouldn't be obvious how to do in assembly. And, unless it relies on some obscure opcode, you can generally turn assembly into C.

No, most hand-written Assembly code doesn't have an analog in C. It's hard enough to accurately decompile a program written in C back into C.

Edit: For instance, a lot of hand-written Assembly code will do fancy things with CPU registers and the stack (if applicable on your hardware) that you can't represent in C because C abstracts both of those things. Hand-written subroutines and flow control and often look and act nothing like C functions and flow control statements as well.

BattleMaster fucked around with this message at 19:08 on Sep 23, 2008

Adbot
ADBOT LOVES YOU

BattleMaster
Aug 14, 2000

Hey don't get me wrong, I love both C and Assembly for different jobs. I just object when people say that C is 'just' a set of macros for Assembly. If you program in Assembly the same way a C compiler generates code you may as well just use C instead!

The compiler will do a lot of things that are a hassle to have to do by hand. There are a few things that translate fairly directly like assignment and arithmetic, but just write and call a few functions in C for your favourite embedded system and take a look at the code it generates and you'll see what I mean.

I didn't say anything about 'fancy' instructions, I was just using that to say that programmers writing in Assembly will use 'fancy' tricks to tailor the code to the job that won't quite be like anything a C compiler could generate. Maybe it was a bad choice of words, but I don't think most people will want to put the effort in to write Assembly code in the same way that C compiler generates it.

hobbesmaster posted:

We're all talking* about a modern RISC modified Harvard architecture that was designed with C compilers in mind. Its much, much, more obvious what is going on when you write a line of C compared to something like a HC11 or 8051.

*I assume we were all referring to AVRs...

I was mostly going after the statement about how hand-written Assembly code translates 1:1 into C most of the time. It's nowhere close to that, even on platforms designed with C in mind, unless you put in a conscious effort to act like a compiler.

BattleMaster fucked around with this message at 00:56 on Sep 24, 2008

BattleMaster
Aug 14, 2000

I have this circuit design that works (schematic) but I was wondering if there were some better parts available. It's entirely based on 74-series ICs and is designed as an interrupt controller for the Z80 CPU.

The 74LS148 is an 8 to 3 priority encoder. It's perfect, but I'd like a version with active high inputs. Does that exist? I'd really love to have to not use a bunch of inverters to get it to work as I would like.

The 74LS244 is an octal 3-state buffer. It's divided into two groups of 4 each with its own enable input. I'd like one with a single group of 8 with 2 enable inputs which would let me lose the or gate. Apparently the 74LS465 is exactly that but it doesn't exist on Digikey and even Eagle doesn't have it in the part list.

Edit: Oops, got the number of the 244 wrong.

BattleMaster fucked around with this message at 03:02 on Oct 17, 2008

BattleMaster
Aug 14, 2000

mtwieg posted:

maybe this would work? Remember, when searching for logic ICs, search all compatible families. HC logic, for example, is compatible with both TTL and CMOS and is much easier to find.

Well hey, that fits the bill just fine. It even has a significantly less stupid pinout. Thanks!

I actually normally look for HCT parts but I build my schematics with LS because that's all Eagle has. I don't know if that's the best choice, but it's ever-so-slightly cheaper and they're CMOS just like most of the parts I work with.

And I've had another look at the timing for the Z80 and I might need to use an octal latch instead of a buffer. I guess I'll create a second design and order the parts for both just in case. Edit: Or maybe not, it looks like a lot of devices keep the interrupt request pin active until you do something to tell it that you're looking after it.

BattleMaster fucked around with this message at 03:56 on Oct 17, 2008

BattleMaster
Aug 14, 2000

RivensBitch posted:

I'm trying to interface an electret condenser microphone with a PIC 16F628A microprocessor. I just need a simple way to let ambient audio influence my program, so a simple circuit that flips a pin on the pic high or low based on a certain audio threshold would be great.

I have a LM324 quad op amp and a simple mic.

Any suggestions on a simple circuit to accomplish this?

That PIC already has two comparators built into it. You may be able to make use of one of them for that.

Other than that, I'd be curious to know how to get that to work.

BattleMaster
Aug 14, 2000

MAH POKEYMANS posted:

Wouldn't it be possible to use a bandpass filter for the frequency range you want to get and then a comparator that detects when your predefined threshold is met. You could then just have the comparators output connected to the external interrupt pin which would then do exactly what you want.

This is of course assuming PICs have external interrupt pins

All PIC16s have one external interrupt pin, but that particular one also has two built-in comparators with interrupt on match.

BattleMaster
Aug 14, 2000

Keebler posted:

Would anyone be able to help me out deciphering the data sheet for a flash chip I'm trying to read and write to from an ATMega?

The data sheet is available here:
http://jthirst.zerofold.com/files/AT29C512.pdf

I had thought that the sector programming operation was the just a series of byte load operations that occur to a sector within a specific time window. In looking at the waveform diagrams though it seems like they are different. !CE and !WE appear to occur at the same time and for the same duration for sector programming despite the description for a byte load indicating that it's used in programming a sector as well.

I'm pretty sure you're right about it just being a series of up to 128 successive writes with the same page address on A7-14.

It's kind of weird that the datasheet waveform shows !CE and !WE going active at the same time because that's contrary to the description of sectpr writes, but there shouldn't be any harm in making !CE and !WE/!OE active at the same time for any kind of operation. !CE is just used to enable the other pins on it, anyways.

BattleMaster fucked around with this message at 02:25 on Nov 11, 2008

BattleMaster
Aug 14, 2000

If you have a language preference you should know that PICs are really fast and easy to program in Assembly, but the C support is lacking. I don't think there are any free compilers available and the official one supports PIC18s only and is really expensive.

I've seen a lot of people who say that the official PIC software tools suck, but I have had a decent time with them. MPLAB is okay, but the tools it provides an interface for are excellent. MPASM and MPLINK kick rear end and I just couldn't live without my ICD2 (hardware debugger).

Edit: MPLAB also comes with a pretty good PIC emulator if you want to debug your software but don't have a hardware debugger or you just don't have the specific PIC on hand.

BattleMaster fucked around with this message at 08:50 on Nov 17, 2008

BattleMaster
Aug 14, 2000

You need to make a voltage divider with the thermistor and a resistor, not a parallel circuit. If you match that 10k thermistor with a 10k resistor, the output should be VCC/2 at the optimal temperature. Edit: Okay, now that you added a diagram I can see that's what you were already doing.

The tricky part is that the thermistor increases or decreases its resistance on a curve rather than linearly so you need to compensate for that somehow. The typical way to do it would be to use a microcontroller with a conversion table in software, but that doesn't seem to be what you want. Edit: I see now that you don't really need it to be very accurate, with only three LEDs.

You would probably prefer using an LM35 temperature sensor, which accurately outputs 10mV per degree Celsius. The datasheet for the LM35 also includes an application note that tells you how to make a bar graph thermometer, but it uses a couple of ICs designed for that task which is probably not as do-it-yourself as you'd like.


I was looking at the datasheet for the bar-graph LED driver and you might want to borrow the design shown in the block diagram if you can't get yours to work.

BattleMaster fucked around with this message at 21:10 on Dec 5, 2008

BattleMaster
Aug 14, 2000

Hubis posted:

Well, that was just a reduction, because I didn't want to put 15 OpAmp/LED circuits down there :) But would a micro-controller really matter? Since I'm looking for thresholds ("Temperature greater than X for LED1, greater than Y for LED2," etc) can I just have my reference voltages scale non-linearly along with the curve of the thermistor? Either way, yeah I'm probably looking at 5'c per LED, so I don't need too much accuracy -- I'm mostly just struggling with getting the reference voltages right and the LEDs to not explode on me at this point.

This page was where I got the impression that I could just use another resistor to make the Thermistor circuit roughly linear -- is that not correct?

You don't really need a microcontroller for a circuit like this, it just makes compensating for things like the thermistor curve way easier when you can feed the number into a lookup table. You can just forget I said that because it's not a very do-it-yourself solution. Down the road, though, if you want to do something like displaying the temperature in numerals on a seven-segment display, it will make it much easier for you if you can stomach the programming.

If that method in that link works, go right ahead and use that. I honestly got fed up with thermistors when I found out than an LM35 is only a little more expensive and a lot more accurate.

BattleMaster fucked around with this message at 21:14 on Dec 5, 2008

BattleMaster
Aug 14, 2000

kaishek posted:

Does anyone know if there is an IC that's essential function is to generate random numbers? My girlfriend is always asking me to "pick a number between 1-10" to help with decision making and I would love to make a little fob that produces a random number at the push of a button. I can wire everything else, including a small liquid crystal panel, but no idea on the number generation.

There's no such thing as a random number generator but you can approximate randomness fairly easily by using a decade counter IC for a range of 0-9. Rig it so it counts up very quickly and stops (or stores the current number with a latch) when you press a button and then display it. Since you can't see the counter's number until you press the button, it may as well be random.

Edit: A lot of microcontrollers have timers that can be used like that if you have any experience with those, and the Z80 CPU has a DRAM refresh register that can also be abused in a similar way.

BattleMaster fucked around with this message at 07:52 on Dec 24, 2008

BattleMaster
Aug 14, 2000

taqueso posted:

Yes, there is. Here is one: http://www.fdk.com/cyber-e/pi_ic_rpg100.htm

Oh, neat. That is a bit complicated for something basic like this though. Is that kind of thing actually as reliable as it says it is?

Anyways if you're going to use a 555 timer and decade counter you should use a latch to hold the current number instead of just stopping the clock. I think it would simplify the circuit. Something like this:



I couldn't be assed to hook up the 555 timer and I swear Eagle doesn't have a basic pushbutton part (pretend there's one between the +5V and resistors), but the rest of it should be okay.

Edit: If your LCD is similar to a seven-segment display rather than pixels you can toss in a BCD to 7-segment decoder and you'll probably have a complete circuit.

BattleMaster fucked around with this message at 19:59 on Dec 24, 2008

BattleMaster
Aug 14, 2000

You don't need to communicate with an iPod it to charge it or else MintyBoost wouldn't work. If you really want to play with it, a glance at that page tells me you can use the UART (standard serial port) on a microcontroller running at 19200 baud with 8 data bits, no parity bit, and 1 stop bit to send or receive data from a device using AAP. The ATMega microcontroller on the Arduino board (The Arduino is not a microcontroller, dammit!) definitely has a UART so you won't have any problems if you go that route.

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.

BattleMaster fucked around with this message at 23:29 on Dec 25, 2008

BattleMaster
Aug 14, 2000

csammis posted:

I never said that it was :confused:

That wasn't really directed at you, and sorry if it came across as being a bit nasty. I just like to make sure people know that they're working with an ATMega168 AVR microcontroller on a board called the Arduino. I think people would learn more if they knew to look up information on AVR microcontrollers rather than limiting themselves to the range of Arduino tools and documentation.

quote:

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?

That's a library that uses software routines to create a serial signal rather than using the built-in hardware. The ATMega168 on the latest Arduino boards definitely has a hardware UART so I don't know why there doesn't seem to be a library for using it.

I don't think it's a lost cause, though. You can probably make your own solution by "manually" loading registers rather than relying on library functions. I wish I could help you more but I have way more experience with PIC and Z80 than AVR.

Edit: The Arduino boards label the UART pins as TX and RX so they seem to intend for you to be able to use it.

Edit 2: This page lists hardware serial output functions. I don't know why it's stashed with the "language reference" rather than the library reference though.

Edit 3: I edit too much

BattleMaster fucked around with this message at 06:09 on Dec 26, 2008

BattleMaster
Aug 14, 2000

Delivery McGee posted:

And now for something completely different: I have a Big Red Button with a covered arming switch (a friend that works at the electronics version of an army surplus store abuses the employee discount for my benefit). What should I use it for? Thermite on the HDDs? "gently caress you" hard-reset switch on my computer? Toss a couple of high-amp batteries in the box and make a general-purpose detonator (and dig out my old model rockets)?

Holy poo poo, I want one of those. I wouldn't even know where to start looking for a store like that in Canada though. I don't build model rockets, but I'd start if I could launch them with something like that.

I'd probably just go the cheaper route and dig out a PIC18F4550 and make a USB panic button, though.

BattleMaster fucked around with this message at 01:10 on Dec 28, 2008

BattleMaster
Aug 14, 2000

Mill Town posted:

Depends where you are in Canada, though. Canada is loving huge. I can tell you where to find such things in Halifax, Montreal or Toronto. Are you anywhere near any of those places, BattleMaster?

Awesome, I thought it was going to be hopeless to find something like that because Delivery McGee said his was military surplus. All the "military surplus" stuff we have here is stolen, fake, or pre-Korean War.

Anyways, I'm close enough to Toronto that it wouldn't be a big deal to make a trip one day. Thanks!

BattleMaster
Aug 14, 2000

Delivery McGee posted:

No, I meant the shop has the same sort of business model as an army surplus store -- they get random salvaged/overstock electronics stuff from everywhere.

drat, I thought you got an authentic Big Red Button from a Titan missile base or something.

BattleMaster
Aug 14, 2000

PICs are easier and faster to program in assembly language. You're not really going to miss out on a whole lot if you go with either product line, so you should go with whatever you like programming in better.

If you go with PICs you might be better off just buying the ICD3 debugger*, making or buying a breadboard cable, and just build your circuits on breadboards. You won't miss out on much unless you want to work with SMT parts that you don't feel like soldering yourself.

*Or just find a cheaper ICD2, I use one and it's good enough.

BattleMaster
Aug 14, 2000

Metajo Cum Dumpster posted:

If AVRs use C, what language do PICs use?

They both get programmed in device-specific machine code. You can use assembly language, where each line translates directly into a single instruction for the CPU, or you can find a compiler for a language of your choice that turns that language into machine code.

AVRs have a free official C compiler so that's a consideration if you already know C. You can always use Assembly but see below.

The official PIC C compiler costs money and the third party ones also cost money or are incomplete. However, they are really easy to program with assembly language because all RAM and I/O peripherals are mapped as CPU registers so you don't spend time shuffling data around as you work with it. It takes more work than C, but you have much greater control over timing and the inner workings of the CPU.

Edit:

quote:

Whats the difference in the higher pin counts? Are all the chips 8-bit? Whats with the different "frequencies"?

1. For the most part, more pins. Sometimes they get special peripherals that require more pins like microprocessor bus interfaces.

2. I believe all AVRs are 8-bit, and all PIC10/12/14/16/18s are 8-bit. The other PIC lines are 16 and 32-bit.

3. Clock frequencies, that is how many times the clock ticks per second. CPUs can do so much per clock tick (cycle) so a higher frequency means you can do more per second.

BattleMaster fucked around with this message at 04:46 on Jan 6, 2009

BattleMaster
Aug 14, 2000

ante posted:

If I jumped right into that, it'd be pretty tough, though. Even wiring everything up can be a hassle sometimes, and it'd all be on breadboards.

Broadboarding a microcontroller isn't that much more work than connecting stuff to a board like the Arduino. A voltage regulator, a crystal or two, a MAX232 if you're using a UART, and some breadboard adapters.

Now I've wired up a system with a Z80 CPU on breadboards and that sure isn't pretty! I'm working on making a proper board before I do anything more complicated with it.

BattleMaster
Aug 14, 2000

Twerpling posted:

I'm having this problem. I have a PIC18F1320 ( http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010265 ) and I connected it to a MAX232 in order to do RS232 serial. Tx is connected to pin 9, Rx Pin 10 and nothing else except power and ground (I removed everything to figure out why this is happening).

I connected a serial line from my computer and was planning on just using hyper term to communicate with the chip. I loaded up some test code and it loads up fine and seems to execute. I get data on hyper term but when I send something from hyper term to the chip nothing happens. I've hooked up my scope and logic analyzer and the signal is getting to the chip.

I'm using the PICMicro C compiler by CCS to do this. Every thing works except receipt of data and it worked before. I've already tried a new chip and tried the simple test code that was provided by CCS. Nothing seems to work. Anyone have this problem? Is there a fuse I need to set?

Does the code set the RX pin's corresponding TRIS bit to input? I'm sure it does if it's someone else's code, but you never know.

BattleMaster
Aug 14, 2000

mtwieg posted:

Make sure you have pullup resistors if you need them (I forget whether they're necessary for a normal max232).

They're not.

I don't know what to say. If the MAX232 is working and hooked up properly then maybe the demo code just doesn't work?

BattleMaster
Aug 14, 2000

Metajo Cum Dumpster posted:

I got 28 UM82C88 bus controller ICs and a ton of empty plastic connectors amongst hundreds of tiny caps.

Haha. I'd buy a grab bag from them if it was guaranteed to have varying quantities of the entire 8080/8088 suite.

BattleMaster
Aug 14, 2000

FuzzyBuddha posted:

Was wondering if someone can help me out with a project I'm working on. I'm trying to take the output of a Garmin eTrex GPS and read the data on an Arduino board. To do that, I'm running (or at least trying to run...) the signal through an RS232 to TTL converter to get the signal "understandable" by the Arduino. The circuit I'm using was one I found while doing a google search, and comes from sodoityourself.com.

The circuit looks like this...


To even get this to work, I had to replace the capacitor between pin 2 and pin 16 with a 10 uF. And this did seem to work, at least for a while, as detailed here.

Only now, it appears that it's only working intermittently, and not at all when I solder it down on perfboard. Is there something inherently unstable about the design on sodoityourself.com, and if so, is there another circuit anyone can recommend?

The MAX232 is a 5 volt part. Are you using 3.3 volt supply or logic levels? If so, you want the MAX3232.

BattleMaster
Aug 14, 2000

FuzzyBuddha posted:

So very true. It's dry and 30 below today. :P

Anyway, I believe the Arduino is expecting a 5V TTL signal, not my ~12V RS232. That's why I tried this circuit. It was the simplest one I could find, and with my solder skills simple is best. :)

RS232 uses a negative voltage that can be as low as -15v to represent a logic 1, and a positive voltage as high as +15v to represent a 0. The Atmega microcontroller on the Arduino board expects ~0v for logic 0 and ~5v for logic 1. The MAX232 part converts voltages between TTL levels and RS232 levels.

Anyways, let's get back to your problem. Are you using a MAX232 or a MAX232A? The MAX232 requires 1uF capacitors, the MAX232A requires 0.1uF capacitors. If you accidentally bought a MAX232A and followed that schematic, it may not work.

Hillridge posted:

Do any of you know of a Hi-Speed (2.0) USB repeater chip? Essentially a 1 port USB hub. I'm guessing that even if I find one, a hub IC will still be cheaper due to their popularity.

I am looking at Digikey right now and there are 4-port USB 2.0 HUB ICs (ISP1520, in stock too!) for as low as $7 CDN in small quantities. I don't think you can get much cheaper than that.

BattleMaster fucked around with this message at 18:56 on Feb 5, 2009

BattleMaster
Aug 14, 2000

FuzzyBuddha posted:

Hmmm, looking at the chip it says: MAX232ECN.

The MAX232E needs the same 1uF capacitors as the MAX232, so I don't think that's the problem. That schematic you linked has a 10uF bypass capacitor while the MAX232 datasheet recommends a 1uF capacitor for that, as well. I don't know if that would make a massive difference but try replacing it.

If that doesn't work and everything else seems fine, try replacing the MAX232 itself if you have a spare. I guess it's possible that you busted it by playing around with the capacitor values.

BattleMaster
Aug 14, 2000

It's not that the external capacitor versions are faster (232/233 and 232A/233A run at the same speed as the counterpart with the A being faster), it's that they're much cheaper.

BattleMaster
Aug 14, 2000

MOSFETs are usually used for high-current applications like motors and power switching. You don't need them for low-current applications such as logic and LEDs.

BattleMaster
Aug 14, 2000

Arduino isn't a microcontroller, it's actually a development board for an Atmel AVR microcontroller (AtMega88). Think of it as an AVR with training wheels - the microcontroller on the board is preflashed with a bootloader and the board itself contains a hardware interface for putting your program on it. It also has an oscillator, voltage regulator, and connects all the I/O pins to breakout headers. The "programming language" it uses is actually C with some headers automatically included.

PICAXEs are similar in concept but are based off of Microchip's PIC series.

Arduino boards are great for beginners, and are fairly popular, but if you want to do something more hardcore later on you'll want to start working with AVRs or PICs without the training wheels.

BattleMaster
Aug 14, 2000

It's for beginners, but it's nowhere close to underpowered. Not like BASIC stamps, ugh.

I personally favour DIY solutions because I'm into PICs, and the PIC product line is downright massive. There's something for everything, and they're dirt-cheap, easy to wire up, and extremely easy to program in assembly (which is an oxymoron on some other platforms).

Of course, until you know what you should be looking for in a microcontroller, you should go for a learning system like the Arduino or PICAXE. And even though I like PICs I'm going to have ot recommend the Arduino since it has so much support available.

BattleMaster
Aug 14, 2000

Has anyone ever used a 65.536 kHz (or faster) crystal as a secondary oscillator for a PIC? I would like full 16-bit accuracy for a real-time clock but the datasheet says explicitly that the secondary oscillator is supposed to be a watch crystal (32.768 kHz).

BattleMaster
Aug 14, 2000

ANIME AKBAR posted:

I don't see why a faster one wouldn't work. Perhaps it has the load capacitors inside and they are sized for operation at that frequency? I'd just try it and find out. Can't really hurt. If you post the datasheet I might be able to see what's up. I'm assuming it just has a normal pierce oscillator.

It doesn't have built-in load capacitors, so that wouldn't be it. I'd just try it out myself but I don't have one on hand at the moment.

The datasheet has a diagram on page 142 of the oscillator internals and a description of the operation on page 143. It says that it is "a low-power oscillator rated for 32 kHz crystals" but I don't know enough about oscillators to know why it would or would not work with a faster crystal.

Edit: Looks like a Pierce oscillator to me, though.

BattleMaster fucked around with this message at 20:42 on Mar 7, 2009

BattleMaster
Aug 14, 2000

It would be better if there was a strict standard, but at least SPI is so basic that it's usually easy to get your application working with any particular implementation of it.

BattleMaster
Aug 14, 2000

One FPGA is worth a hell of a lot of 74-series ICs.

BattleMaster
Aug 14, 2000

Jailbrekr posted:

Ya, but wouldn't it be fun to wirewrap all those 74-series TTL chips?

:gonk:

I'm considering buying an FPGA development board because working with a Z80 with I/O and memory management logic built in 74-series is pissing me off. With an FPGA I could put all that crap on one IC with external RAM and ROM.

Those Atmel FPSLICs look badass, too. The main advantage is that RAM and ROM with FPGA gates is kind of wasteful (right?). Not to mention that there may not be an AVR core available if you wanted to build your own.

BattleMaster
Aug 14, 2000

You can make a standard USB HID (keyboard, mouse, joystick, etc.) device with a PIC18F4550 and some firmware provided by Microchip that does the hard stuff for you. I think they sell a demo board with that part on it, too, but it doesn't require very much external hardware to run (A crystal and some capacitors) so you can easily make a compact DIY solution.

Not the easiest way to go about it (easier than cutting up an existing keyboard though) and probably not recommended if you've never worked with a PIC before, but it's fairly well documented and only requires a single chip and a few other parts to make whatever you want.

BattleMaster fucked around with this message at 18:30 on Mar 17, 2009

BattleMaster
Aug 14, 2000

Are there not AVRs with hardware USB? Doing it in software like that is kind of gross.

BattleMaster
Aug 14, 2000

For only a couple of dollars more you get a lot more functionality, though. That software USB implementation only supports low speed USB operation and requires a whole bunch of external hardware. Maybe it would be worth it if you were mass-producing keyboards and wanted to save money, but I'm not so sure if it's a good choice for a hobbyist project aside from the novelty value.

I don't know about the equivalent AVRs, but the PIC18F4550 has a built in 3.3 volt regulator so it can be plugged directly into the +5v USB power, as well as a built-in transceiver and pull-up resistors. It also has a really flexible oscillator system that lets you derive low speed and full speed clock rates from any crystal that's a multiple of 4MHz, has 1KB of dual-port RAM for configurable buffers simultaneously accessible by the CPU and USB module, and a parallel port that allows the USB module to bypass the CPU entirely for streaming data.

What I mean to say is you'd have to be really desperate for that dollar or two you'd save to pass up all that. Hell you might just make it up by not having to add in an external voltage regulator.

BattleMaster fucked around with this message at 23:28 on Mar 17, 2009

BattleMaster
Aug 14, 2000

Are there any downsides to using an op-amp IC that only requires a single positive supply such as the LM2904?

Adbot
ADBOT LOVES YOU

BattleMaster
Aug 14, 2000

Since we're talking about exploding capacitors, I guess now would be a decent time to ask if this circuit is going to kill me or not.

Someone on another forum was talking about using supercapacitors to keep something running during a power outage. I looked them up and then played around with the idea of a circuit that remains operational for a short time after losing power, so that it doesn't lose data when changing batteries or something like that. Here's what I came up with:



What I'm trying to do is have the capacitor charge when the circuit is powered from an outside source (wall wart, battery, etc.) and discharge when the power is cut. The transistor (or FET or whatever it ends up being) is supposed to cut off ground when the power is removed because otherwise the capacitor would discharge too fast.

Will this even work? And is a 5 volt, 0.47F capacitor big enough to harm a human? I don't see any warnings anywhere about it but that's a fuckload bigger than anything else I've used.

BattleMaster fucked around with this message at 05:17 on Mar 23, 2009

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply