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
clredwolf
Aug 12, 2006
Remeber to decouple the inputs and outputs out of that thing, are you're going to have some nasty ground loops (or worse!). Use the largest, bestest cap you can get away with and not have it sounds like crap (so Mica, Polystyrene, Polyester, or C0G ceramic...personally I think X5R or X7R ceramic is fine but someone's probably going to beat my rear end with a shoe for saying that). The schematic on the LM1036's page includes these (they are the .47uF caps on the inputs and outputs).

That LM1036 is pretty complex for what you want to do, but it will work. Make sure your dimmer control is the right resistance, you may have to tweak around with the slider resistor until you get it to where you want.

Another question is do you necessarily have to use a digital pot? It may be easier to have the dimmer pot control an analog circuit that controls the volume. An opamp or two (per channel) and you're in business.

Note also for the LM1036, you do NOT need a split, rail power supply. You might want one if you are amplifying it's output, but honestly I'd much rather bias the audio signal up and decouple the output for what you want to do (which you can use a single-rail opamp for).

Adbot
ADBOT LOVES YOU

clredwolf
Aug 12, 2006
You can do a linear to log conversion with opamps and a diode. Use the dimmer to pass a linear DC control voltage to the opamp, and get a DC logarithmic control voltage out. It may be a little wonky, and you probably will have to play around with it until it gets about right.

Then pass that CV to an opamp-based amplifier with adjustable gain controlled by the CV. You could also do it with a VGA (variable gain amplifier), which is just an IC (and pretty simple to use, just gotta find the right one), and set it up so your CV is between 0V and 1V (or 0V and 2V works too). There are also discrete component VCA (voltage controlled amplifier) schematics floating around. This one looks pretty simple , just another opamp and a few generic NPN transistors (probably 2222As or 3904s). This site has some too, the VCA2 there looks promising.

Opamps are fun!

clredwolf fucked around with this message at 18:35 on Jan 30, 2009

clredwolf
Aug 12, 2006
None at all, datasheet even lists 12volt characteristics. That's probably the smallest way to do it outside of SMD parts. Good luck to ya!

clredwolf
Aug 12, 2006
Even still triacs are cheap as dirt for what they do.

4 bux, and it's still overkill

clredwolf
Aug 12, 2006
It's 4 extra caps too, of the most common cap value known to man. It's not exactly like they're asking for gold-plated thermoresistive ionic couplers or a still-beating human heart.

Plus the MAX232 is second soruced to heck and back, so you can find them anywhere for cheap. Digikey lists some for 90 cents a pop. For the money saved between it and the cheapest MAX233 I found ($7.45 on digikey for 1). Since 0.1uF through hole caps are 16 cents a pop *or less* you can buy several MAX232s and caps for what one MAX233 costs.

clredwolf
Aug 12, 2006

scuz posted:

Ugh, that is a life-saver! I was pretty discouraged when I couldn't figure out simple poo poo, but that's so much easier for me.

I flipped through the table of contents (which you can do on amazon.com, I just figured out) and didn't see Kirchhoff's node current law, Kirchhoff's voltage loop law, Thevanin equivalents, Source transformations, or Mesh current/Loop current method stuff anywhere, but that doesn't mean that it's not in there, just that it doesn't have a chapter devoted to it. Thanks for the guidelines!

It's probably in there, it would be weird if it's not called that by name though. Read over the Lessons in Electric Circuits site posted in the OP, should give you a primer on those simple techniques (particularly chapters 6 and 10 in the DC section):

http://openbookproject.net//electricCircuits/

If anything you'll know what to expect. It's pretty tricky at first, but over time it gets easier (especially since problems written for Kirchhoff laws and source transformations in general seem to be written by sadists).

Two mantras that help with the laws:
-'Voltage is the same across parallel elements'
-'Current is the same across series elements'

if you think about it, it's the same is 'voltage is across, current goes through'.

Also, node voltage analysis is an extremely robust way of analyzing circuits, especially when funky things like opamps start getting thrown in.

clredwolf fucked around with this message at 21:39 on Feb 12, 2009

clredwolf
Aug 12, 2006

ANIME AKBAR posted:

check out my post here:
http://forums.somethingawful.com/showthread.php?threadid=2734977&userid=0&perpage=40&pagenumber=21#post351068809

If you're looking for logic and switching circuits, stick with mosfets. If you want analog amplification or instrumentation, go with bjts. If you're not sure what you need, feel free to ask.

Also in terms of price mosfet's are perhaps a bit more expensive, but not by much. Decent ones can be had for less than $0.50 each.

My take on the matter from my experiences:

BJTs - Super cheap (you can find 2n3904s ANYWHERE), easy to find in discrete packages, harder to understand but have several advantages that make them very useful.

Advantages

  • High frequency response from most models
  • Large # of discrete packages
  • Very stable operation (if you get it right)
  • Cheap
  • Relatively high voltages out of the box (3904 is rated for 40V)
  • A lot more resilient to the elements than MOSFETs

Disadvantages:

  • Trickier than MOSFETs (IMO, not that much trickier)
  • Smell bad when they burn out (you get used to it though..also it's good they're so cheap)
  • Lots of WTF factor if you screw up

Good for:

  • Analog Circuits (aka A/V stuff)
  • Simple inverters for driving high voltage circuits (like, oh, H-bridges)

Now for MOSFETs:

Advantages:
  • Easier to understand (high gate voltage = on for NMOS, opposite for PMOS)
  • Power MOSFETs have crazy low resistances (perfect for DC motors, heaters, high current stuff)
  • Tend to be easier to troubleshoot (in my opinion, maybe not so much for others)
  • When they fail they tend to fail spectacularly (wait, isn't this a bad thing?)

Disadvantages:
  • More expensive (so each one that smokes makes you die a little bit inside)
  • Tend to die a little bit easier (static shock), and when they fail they fail *closed*, not open (so they take out the rest of your circuit too!)

Uses:
  • Digital Logic (use HEF4007 or similar 'light duty' MOSFETs here)
  • Switching really large currents (use IRF510 or similar power MOSFETs here..they can be a bit pricey)
  • 'Experimentation' (although once you are familiar enough with a BJT you can and should play with those too)

clredwolf fucked around with this message at 21:30 on Feb 16, 2009

clredwolf
Aug 12, 2006
Wow that's weird. Any articles about this phenomenon?

From what you've said, it sounds like some kind of interference is coming down the flash through the shoe into the receiver. If that's the case, the flash shoe doesn't have to be all that fast, so you may be able to make some progress by decoupling the shoe on the receiver. I'm warry to give advice without knowing more about what's going on, but if that's the case you should be able to put a cap between signal and ground of a relatively small value (maybe 10nF or so) and get rid of the high frequency noise.

Again, link us to some kind of description of what's going on so we don't give you advice on screwing up your flash beyond all recognition...

clredwolf
Aug 12, 2006
Ok, here's what I'm seeing:

-Longer cord helps. The long cord acts like an inductor, which lets low frequency signals pass but stops high frequency signals.
-Capacitor doesn't help, is a small value. That tells me your value is too low, and is missing the radio interference that is screwing up your signal.
-0.01pF sounds too small. Sure that's not 0.01uF?
-Toroidal core may help. It would look like this. You wrap the cord around it a whole bunch of times tightly, and it makes an inductor. I don't know if this is something you can get at Radio Shack though. This would be more effective than a ferrite bead.

Your flash 'trigger', if I understand right, is just an 'off' is no flash, 'on' is flash', and that 'on' needs to be fast but not radio frequency fast.

Have you tried a combination of the cord and the capacitor (placed on the side of the receiver, away from the flash)?

If that doesn't work, move up to a 1uF cap. Work up to 10uF until it works (don't use polarized caps). If *that* doesn't work, then it's time to bring in the big guns...

clredwolf fucked around with this message at 06:33 on Feb 17, 2009

clredwolf
Aug 12, 2006
Question, where do you get a whole bunch of those 0.1" (2.54mm) breakaway connectors for cheap? You know, these guys (only those are overpriced as crap)?

clredwolf
Aug 12, 2006
I found some 50pos headers for $1.50 on digikey after some further poking around. I was under the impression they would be much cheaper than that, oh well...

clredwolf
Aug 12, 2006
East coast is a bit sparse on surplus electronics stores (I am so jealous of you Californians discovering electronics!). May be something around though, I'll take a look...

clredwolf
Aug 12, 2006
Honestly don't bother with the resistor, for what you are doing you don't need it. You can substitute a low resistance in your approximations for where the resistor is now (like 1 ohm or something).

Also try a shorter cable if you're not going to wrap it around some sort of ferrite core. Heck, try wrapping it around some sort of iron rod or something, that may have an effect.

clredwolf
Aug 12, 2006
Lol, you're getting into 'crazy engineering ideas' territory now. Got a mosquito you just can't squash? Bring out the largest artillery gun you can possibly find, and strap a nuke to the shell...

You can try the capacitor on the other side of the cable. Honestly I'd look at shortening cable length now, seems like it's not helping to have a cable that long even with ferrite beads and whatnot.

clredwolf
Aug 12, 2006
I'm up in Raleigh. We have tons of companies within an hour or so of here (IBM, Analog, RFMD, RTP), but no surplus from what I can tell. Woo...

clredwolf
Aug 12, 2006
You could look at sending a high frequency signal, above POTS in a different channel (kinda like DSL, but low bandwidth). You can do that pretty easily with digital filtering, but you may have to install low pass filters to keep your signal from interfering with the normal network (you may even be able to use the ones that work with DSL lines, those would be easy to get ahold of). It's not sending DTMF tones per se, but it keeps your system from interfering with the normal operation of those phones (important, since they are emergency phones), and you can even build another POTS system straight on top of it (provided the lines will handle it), although that may be overkill.

If you wanted to do it in a way that's not 'hackish', you could use SMS messaging over landline (some networks can do this, I don't think it ties up the line but I don't know for sure), or even just over GSM and skip possibly tying up/screwing up the landline altogether.

clredwolf
Aug 12, 2006
I've switched over to water soluble flux pens because of crap like that, and wash all my boards after each solder session. I think it's harder on the boards, but it keeps stupid crap from happening...

clredwolf
Aug 12, 2006
Honestly I'm in an electronics club now, and we're using Arduinos to do tons of things that 'beginner' boards just shouldn't be able to do (admittedly doing tons of register manipulation). You're limited to some pretty puny microcontrollers but it's really nice that you can just start coding and not worry about having to set everything up each time. That and for us, we can get 'newbies' started out doing stuff and let the veterans work on the crazy complicated stuff.

That and the sheer number of libraries available for the Arduinos is amazing. Just about anything you want to do there's example code for (cept high-speed SPI, that's a bitch).

So yeah, they're slow dogs and pretty underpowered, but never underestimate the power of a huge library to work from and a system where a lot of the hard work is done for you (correctly).

clredwolf
Aug 12, 2006
I'm used to Blackfins and ARM7s being my metric for 'powerful', so they're underpowered by my standards, but compared to generic PIC16s and whatnot yeah they're plenty beefy.

PICs are really good to learn too, since they're absofreakinglutely everywhere and super super cheap. Any legitimate project that's going to be produced in large quantities should favor a PIC or AVR on bare metal over Arduino or something, and use Arduinos/PICAXEs as prototyping environments. For just screwing around, kinda depends on your personal views, do you like talking to the bare metal or do you just want to be up fast.

I do both, so I guess I'm just doubly crazy...

clredwolf
Aug 12, 2006

ANIME AKBAR posted:

Is it possible to mix assembly in with arduino code? Always wanted to try it, since it would make them a lot more flexible.

I'm also starting to hit the peak of what the midline atmel chips can do (I've been using the mega series). They've got new stuff out like the picopower devices which are pretty impressive, and Xmega is supposedly coming soon, but I really should look into a 32 bit architecture like blackfins or ARMs (not to mention FPGAs). Thing is at that point using assembly would become unbearable, so I'd really have to teach myself a bunch of computer science crap to properly utilize them. Also I really need to learn Labview, it's such a great program.

I've been writing to registers directly on the Arduino to control some PWM stuff, seems to work alright. It's kind of a pain sometimes though, and there are a LOT of limitations to what you can and cannot do. Some things are going to be just flat-out easier in full assembly (anything beyond just simple register control and invoking some peripheral hardware probably needs this).

For Blackfins and ARMs, uCLinux is prettymuch the only way to fly when it comes to free platforms for those architectures. Labview is great but not really in the reach of hobbyists (if you have access, lucky you). I've got a huge project I've been doing on the Blackfin, unfortunately just getting the darn thing to boot is proving to be problematic enough (grr SPI why are you so hard to deal with?).

FPGAs are sweet little beauties, and you can do some CRAZY stuff with them. Like, oh, crack SHA-1 codes at absurd speeds or help make your supercomputer more 'super'. Really they've gone from esoteric curiosity to amazing enabler for all sorts of crazy projects that wouldn't be possible otherwise, and somebody is probably going to use them to take over the world someday.

When programming FPGAs, make sure to take the time to learn Verilog properly (or enough to know the difference between blocking and nonblocking assignment, how to simulate a design, and how to write a basic test case). There are unfortunately few tutorials on it, although there are plenty of books and tons of code examples. It's NOT a computer programming language, and if you treat it as such you will get crappy modules that don't work half the time.

Also, companies will hire you on the spot if you mention that you know what Verilog is, that you've messed with it once or twice, or that you know a guy who knows a guy who programs verilog. That's not even that exaggerated. It's a great skill to develop for the budding engineer, and it's going to be a major skill for hardware hackers for a long time to come. Same goes for VHDL, although I see far more projects in Verilog now...

clredwolf fucked around with this message at 06:02 on Feb 27, 2009

clredwolf
Aug 12, 2006
Oh man, why doesn't NCSU offer that? That sounds like an amazingly useful course! Definitely take it if you can.

You can use VHDL or Verilog for FPGAs, along with wire schematics, ADL, and a slew of other methods. Verilog is by and far the dominant one, and it's based (loosely) off of C, written originally by engineers at Cadence. VHDL is based off of ADA, and was written by the US Department of Defense. Both can be picked up, it's my opinion that Verilog (esp with the 2001 changes) is better, but others would beg to differ. Verilog itself is used a LOT in industry (esp in the US, I hear Europe likes VHDL more), so if you want to ultimately get a job with this stuff Verilog is a great skill to know.

Just remember, reg =/= register, blocking for combinational logic, non-blocking for sequential/register logic, and BY GOD DO NOT GET CREATIVE WITH CLOCKS! If you have to send your clock through a gate before it clocks a flip-flop, it's the same deal as using 'goto' in C (I slash your car tires).

For uCLinux, I agree, it is kinda scary giving all that control to the Kernel. It does simplify a lot though, and it's nice to be able to just telnet into your microcontroller. It's a huge tradeoff.

clredwolf
Aug 12, 2006
Agreed, clock gating is great but there's definitely a right and wrong way to do it. I'm talking more about, oh, using XOR gates and buffers to offset clocks, to generate a clock with 10% duty cycle INSTEAD of using the PLLs already onboard the FPGA. Don't do that. Don't. Ever. Do. That.


Also, Xilinx is the ATI of the FPGA world in my opinion. Their stuff is great, but a lot of their software just makes me wonder what the heck they were thinking. Then again, everytime I look at how the Quartus GUI is laid out I think the same thing... (not like ISE is much better)

I've also heard various people tell me that Altera FPGAs tend to be faster, although to me that's like saying a .44 kills a little better than a .357 when you shoot someone in the face.

clredwolf
Aug 12, 2006
I haven't used a Lattice, I've only worked with Xilinx and Altera FPGAs. We're looking to use some generic FPGAs for random data routing, I'll have to look into them and give them a try.

Provided their software isn't terrible...

clredwolf
Aug 12, 2006
I was looking around, their prices are better than a comparable Altera Cyclone III chip ($47 vs $60 for a 16k LUT). I don't think they're all that much better than some of the Cyclone II chips ($42 for 20k gates). Not exactly sure how to compare the speed grades, but the Lattice might be a faster chip.

We've already got Xilinx and Altera chips to mess with (yay 2nd hand electronics) so it's not like we're looking to strongly switch. There was some talk of making an 'FPGA Shield' for an Arduino though, for some of our really complex tasks. We had a low, low end Cyclone II in mind for that one, maybe bumped up to a Cyclone III if we don't go crazy making it...


Anyone have experience with open source JTAG tools (hardware and software)? Do they work for FPGAs at all?

clredwolf
Aug 12, 2006
Hmm ok, I'm working on a program to program an FPGA over a modified SPI port (using serial programming, not JTAG programming). Slow, yes, but if it works I don't care. Obviously JTAG would be very nice, but if it's not there it's not there.

clredwolf
Aug 12, 2006
That's a big number of FPGAs man. Guess Xilinx figured they make enough off you anyways :D

clredwolf
Aug 12, 2006
Headphone amp? You may have to resort to SMDs but you can use larger ones (1206).

clredwolf
Aug 12, 2006
That oscope looks sweet, I want one of those kits. I can't tell what size those components are though, wish they had a bigger picture.

If you want to solder SMDs, buy a good pair of tweezers. You CANNOT effectively solder SMD without them, or at least w/out going crazy. Best trick I've learned is to put a crappy joint down on one side of the part to tack it down, put a good joint on the other side, then use some flux/extra solder to clean up the crappy joint. It's tedious, but I get good results. If it's 0805 parts or smaller, try to find a good magnifying glass, or retrofit a microscope.

Good luck!

What are you doing with charge pumps btw? I'm interested in learning some more about those...

clredwolf
Aug 12, 2006
Very nice job. I see a few little blobs here and there, but nothing too messy. On that PLCC on the bottom, I think having more heat and/or using a slightly bigger iron tip may help.

Otherwise, very good job!

clredwolf
Aug 12, 2006
Those FETs are gonna be eating up an awful lot of power, especially near the 1 and 10 ohm resistors. Also, even at lower voltages there's a significant blowthrough because at Vin=0V, your transistors are all partially on, and letting as much power through as they can.

It's an interesting design, I'm not sure what all needs to be done to make it workable. It looks a lot like a 3 stage half-hbridge design, which is very intriguing. You have the makings of a class D amplifier, although something tells me that's not what you were going for.

clredwolf
Aug 12, 2006

Cyril Sneer posted:

Jesus christ. Does nobody study RF/E&M anymore?

I am. Holy poo poo I'm really starting to love RF/Mixed Mode design. I do admit most of the classes have 'bend over' written somewhere into the course description, but I just can't get enough analog design.

I'm taking a 'beta test' class now (special topics) in high frequency amplifier circuits and it's absolutely fascinating. Covers Agilent Design Studio, Gallium Arsenide Transistors (pHEMT and HBT), stability and noise with smith charts, line matching, etc. I was able to make a 1/4 wave transformer the other day out of aluminum foil and scotch tape, and using ADS burn a huge hole in my microwave's glass plate. (Yes, I was very bored, and yes, Guinness was involved).

I'm also taking semiconductor physics. Really not my thing, but I think I better understand how transistors/diodes work. I just hope I can pass the drat course...

Why do I always have to do things the hard way?...

clredwolf
Aug 12, 2006
Don't forget the Gaincard. $2300 and it's two ICs from National (lm3875) that's ~$6.30/ea. I don't think it even deviates from the reference design, which is only a handful of components.

clredwolf fucked around with this message at 03:26 on Mar 23, 2009

clredwolf
Aug 12, 2006

Corla Plankun posted:

Is there any advantage to tantalum capacitors? They sound ridiculously dangerous. I don't understand why they would ever be an option.

They usually aren't unless you're running high levels of power through them. They have a lot of capacitance for a pretty small area, and they're used a ton in SMD boards for that reason. Also some audiophiles have hard-ons for them, but well lemme tell you a story about audiophiles...

Oil-filled caps can catch fire too. Aluminum electrolytics burn too, and are hilariously fun to microwave.

clredwolf
Aug 12, 2006
Me and some friends had an impromptu 'poo poo that looks cool in a microwave' buildoff. Holy poo poo we had some awesome sparks. Best ones were:

-Spark gap with dipole antenna made from a coke can (held together with tape)
-coupled lines separated with some weird sticky goop we had lying around, connected to part of a dipole on each side
-spark gap with wires from a cat5 cable making a dipole

We had to have tried like 30 different ways to make sparks. I will try to get some video up at some point, phone has some weird proprietary video format.

So I ask you DIY...what is the biggest baddest microwave spark you can make?

Hint: A microwave is just a big oscillator firing into a cavity. Said oscillator oscillates at 2.4GHz.

clredwolf
Aug 12, 2006
Ohh, PIC32. I've got me an MX440 from a failed project, I love the chip but I can't stand MPLAB. There's just something so elegant about MIPS...

clredwolf
Aug 12, 2006
This is a crapshoot, but has anyone messed with lvds signals on Xilinx FPGAs? I'm having trouble with mine...

clredwolf
Aug 12, 2006

SnoPuppy posted:

Yes. What problems are you having?

So I have an ADC with an LVDS output. I have three channels I'm using: bit clock, frame sync, and actual channel data.

I got some sample ADC code for the device but it's not working very well. Even small changes seem to screw it up. I'm thinking I'm not meeting timing, even though Xilinx is telling me that I am. I'm not as familiar with timing in ISE as I am in Quartus, so I could be missing something.

So how do I handle LVDS clock signals, especially high speed ones? (The bit clock is like 350MHz, hella fast)

Right now, here are wires on the top module for the lvds signals:

bitclock_p, bitclock_n
framesync_p, framesync_n
data_p, data_n

I have bitclock_p marked as the clock. Bitclock_p and bitclock_n go to an lvds buffer, which feeds into a PLL. The PLL never locks (bad sign) and I get all sorts of transient errors. I don't think I'm handling LVDS clocks properly. I tried marking both bitclock_p and bitclock_n as clocks, and that didn't work any better!

I'll show some sample code in a bit, I'm not at that computer. I do know that I have an lvds buffer set up like this:

ibufds( .o(bitclock), .i(bitclock_p), .ib(bitclock_n) );

clredwolf
Aug 12, 2006

SnoPuppy posted:

Hmm...this wouldn't happen to be an 8 channel, 14 bit, 50 MSPS analog devices chip, would it?

What FPGA are you using?
And, the 64 thousand dollar question, are you using external termination resistors or have you turned on the internal LVDS termination (it's off by default)?

Ok, I lied. There are a few other questions.

Is the clock coming in on a global clock pin or a regional clock pin?

Is your PLL configured correctly (i.e. appropriate multiply/divide settings)? Also, why are you using the PLL?

Have you taken a scope to the clock input at the FPGA? Does it look clean?

Yerp, that's the chip (I'm neglecting all but one channel for now). I'm using their evaluation board setup with a Virtex 4 VFX20. DIFFTERM = TRUE, so internal resistors (and their on).

I think the clock is coming in on a global clock pin, but I'll have to check.

The PLL was used in the original code. I tried to bypass it and it flat out stopped working. It's a DDR output from the chip (data on positive and negative edges) so I get the feeling there's some phase craziness going on.

I stuck a spectrum analyzer on the clock input to the FPGA, and it looks like a great square wave. I think the hardware side of things is fine.

Fifty-Nine posted:

I would have assumed the synthesizer would figure this out automatically, but perhaps you could run the output of the ibufds through a global clock buffer (bufg)?

I'm looking at some code I worked with recently that used an LVDS clock for RocketIO, and it looks like it does ibufds->bufg->pll_adv to generate the clock. Here's the code, for reference: http://code.google.com/p/infinibandfpga/source/browse/trunk/Physical/RocketIO_Wrapper.vhd. REFCLK_P and REFCLK_N are the differential clocks.

I tried that as well, that's how it was set up originally. It worked like that, but changing the code around really messed with it. I'll take a look at that code though. I'm a Verilog guy though, reading VHDL gives me a bit of a headache :(

clredwolf fucked around with this message at 20:54 on May 3, 2009

clredwolf
Aug 12, 2006

SnoPuppy posted:

Wait...you're using a V4 with a PLL? Do you mean a DCM? Because V4's don't have any hardware PLLs.

Two more dumb questions, but you didn't accidentally swap FCO and DCO did you?

I know you said you have DIFFTERM=TRUE, but you are applying it to the correct IBUFDS instance, right? Have you checked with the FPGA editor? Or looked through the map report (that *.mrp file that ISE spits out)

There shouldn't be any weird phase stuff going on with that chip, if I remember correctly. The fact that the DCM isn't locking (I assume you're monitor the lock bit in some way) would indicate either that:

a) the input clock is bad. You should be able to tell this by driving it back out of the FPGA and checking with a scope or something.

or
b) The DCM is misconfigured. This is less likely, since they're pretty easy to deal with. Just look through the V4 users guide to check.

or
c) The ADC was not up and running when the FPGA bitstream was downloaded, or you didn't reset the DCM once its input clock was stable. You always have to reset the DCM if your input clock changes.

Either way, you don't need a DCM to deal with this ADC. Just shift your input bits from the DDR flop into a register. Treat FCO as a data bit, since it has identical timing characteristics to the data bits. Then latch data out of your shift register when the FCO register matches "11111110000000". Then shove the data into a FIFO to cross the clock domain to whatever your "slow" clock is.

Make sure you have all your proper OFFSET IN constraints for the DDR flops specified.

I highly recommend making use of the debug modes on the chip while you're troubleshooting. They send out known data patterns and let you very easily catch off-by-one and timing errors.

Err yeah, DCM. My mistake. It has a DLL and I conceptualize it as a PLL.

DCO and FCO are correct. DCO is not locking, I have the lock bit brought out to an LED.

I haven't checked the MRP file, I'll do that next. I have the buffers set up like this though (I had to look back, it's not what I stated before, opps!):

code:
IBUFDS #(.DIFF_TERM("TRUE"), .IOSTANDARD("LVDS_25")) IB_NUM (.O(data), .I(data_p), .IB(.data_n));
That is some really good information you gave, thanks! I have been using the debug modes liberally and it's the damndest thing. When I use the 'user pattern' output it works perfectly (00-7f give positive values, 80-FF give negative values in twos compliment output). However when I try to capture 8k-sample chunks of data from the ADC it's corrupted and ratty (noise floor of -40dB, should be much lower). My test patterns show massive digital errors across several samples (sawtooth waves with spikes in the middle of the wave). I am treating the FCO as a clock, perhaps that is where some of my difficulties are arising. I can try to switch over to using the DCO for everything, I'm worried it's going to be too fast but I can try it just to see. I'll try those tips tomorrow and let you know the results!

Thanks for the help SnoPuppy!

Adbot
ADBOT LOVES YOU

clredwolf
Aug 12, 2006

SnoPuppy posted:

Glad to help.

Those sounds like timing problems to me. I would guess that's due to using the FCO as an actual clock, without safely crossing that clock domain. Even though they're supposed to be related, if the tools can't tell then they won't take it into account. I suppose you could attempt to constrain it more (related clock period constraints), but that feels fragile to me.

I believe you should be able to output a checkerboard patten from the ADC - that should make timing errors more evident. Also remember, ISE will generate a bitstream even if you fail timing, so make sure to check the log.

Ugh it's still having major issues. If I have it so that only the doc OR fco is the clock, running a test pattern into my fifos only, it seems to either do the same thing (digital errors every couple of samples; that's if I keep the PLL) or just not show anything at all (buffer never fills; that's if I remove the PLL, for both DCO and FCO). I'm bringing the board home with me to give me company while I get my wisdom teeth pulled, so I'll keep at it. Remote access ISE sucks though...

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