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
dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I ended up buying one of these after reading the last few posts about FPGAs: http://www.latticesemi.com/en/Products/DevelopmentBoardsAndKits/iCEstick.aspx

I have a project that an FPGA would be perfect for, it's just really tough to pick out a relatively pricey piece of silicon from all of the marketing, especially when I don't know a whole lot about them. Things like how much power a design uses on an arbitrary FPGA seems completely indeterminable to me. Converting from CNF to some number of LUTs and flip flops isn't obvious to me, but I can guess. It turns out Lattice sells a slew of cheap dev boards though, I'm not sure why I thought they were all (still?) several hundred dollars. It might be a good option for others that have the same dilemma.

Also the datasheet for it is really easy to read and really detailed: http://www.mouser.com/ds/2/225/iCE40FamilyHandbook-311139.pdf

Adbot
ADBOT LOVES YOU

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
This seems like the most appropriate place to ask this ...

I'm taking a computer architecture class that requires us to use the QtSpim MIPS simulator. For some homework I wrote a program that uses macros so I didn't have to repeatedly write out the tedious IO calls. Here's one:
code:
.macro print_newline
	la $a0, newline
	li $v0, 0x04
	syscall
.end_macro	
When I load my program into QtSpim, it gives me a parsing/syntax error. From what I can find, there used to be a old separate preprocessor for Spim, but it doesn't seem to be packaged or implemented with QtSpim. Am I missing something? The QtSpim stored help has a very similar macro example where it prints out an integer, which really confuses me since it doesn't work either.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I don't know about arduino, but could you poll it on each loop? If it is high, and on the next loop it's polled low, then you've got a button press!

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Eeyo posted:

I'd think waiting for the button to unpress would also have the same multiple-hit issues. Buttons usually 'bounce' multiple times on both press and release. Unless you added in some dead-time after the un-press registering.

Ah, good point, I wasn't sure what was meant by "register", I assumed that the switch or board came with one ...

On that note, it's a lot simpler to either add (sorted by decreasing laziness and increasing cost) an rc circuit or schmitt trigger to the switch, or to buy a switch with the circuitry already in it. I was trying to find you a few of the latter, but the only reason I know they exist is because I ordered them on accident.

dougdrums fucked around with this message at 15:47 on Sep 8, 2015

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
Oh, well I'm my own hardware guy, but that's kinda moot since I haven't sold a design in awhile. I figure it's a trade off like anything else, and doing it in software saves some cost and board space, and maybe someone else's time. I find it simpler to take the hardware approach, I mean if there's an engineer that freaks out over debouncing a switch when it's not a case of "oh, by the way ..." or for some reason you've gotten that far without it coming up, I'd be a bit worried.

Actually I never just used an rc in anything important, I always get schmitt triggers or the dedicated ones. I've always been under the impression that you need the hysteresis to avoid any issues but it seems to work alright for everyone else? I think that's the answer for why you do both, you could still catch the switch in a bad state if it was rc alone, but if you do it in software too you get a sort of hysteresis.

Also I wrote this post before I read the one above, that's pretty reasonable. I mean if someone just told me what the timings were and expected me to work with it, it's most certainly better to just do my job instead of griping about it for no reason.

And if you're just learning, there's no harm in trying all of the approaches ;)

dougdrums fucked around with this message at 03:52 on Sep 9, 2015

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
... whoops, nm

dougdrums fucked around with this message at 16:10 on Sep 14, 2015

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I ordered two samples of a PIC I hadn't used before from Microchip on a Saturday, and Monday morning at 8:30 the fedex guy was at my door with a package from Thailand, and now I'm on a sampling rampage too.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

xilni posted:

What? How does one get in on this sample binge?

https://www.microchip.com/samples/default.aspx

I'm a student right now, so I just registered with an .edu address with microchip and ordered up. There's a limit of two different types per order, but it hasn't been a problem. When I had an actual business before, they'd take 1-2 weeks or something like it said when you ordered, that's why I was so surprised. I actually ordered some from digikey when I realized that I needed to get them sooner, but they still arrived beforehand. Using a PIC16F1454 in this one design saved me a ton of stuff, so I decided to get some of their high-end ones to see how they compare to others in that regard. And I also needed some gigabit ethernet phy's, and maybe some Li-Poly managers ...

Slanderer posted:

One downside is that Atmel does not give away free samples, which is a big deal for broke college kids. For that reason, I'm kinda surprised that there isn't more stuff being done with TI's MSP430 line---unlike other companies, TI has always been good about giving samples of DIP packaged parts, whereas others exclude them specifically because of hobbyists. I did a lot of stuff with Cypress PSOC's when I was in school because I was able to get free samples of breadboardable parts that did all kinds of cool stuff.

I have TI's memory display breakout, but I hooked it up to one of those ESP8266's to try to make a hand thermal-powered wifi computer terminal and it still drew too much power :(. I think I might get me some MSP430 samples and try again though.

dougdrums fucked around with this message at 00:55 on Sep 18, 2015

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
http://www.clifford.at/icestorm/ for the Lattice Ice40's exists. http://opencores.org/projects also has a bunch of code (great for learning!). This is the only FPGA I've ever gotten to work, Lattice's software works alright if you read what there is of the manuals. It at least outlines what your workflow should be, step by step. The only other one I've ever dealt with was a Xilinx Spartan from about 9 years ago. They happened to have one where I was at, and we couldn't get it to do a drat thing considering none of us had FPGA experience. An open source FPGA would be a dream ...

I've been working on getting it to run a grid of LED's, something it seems to excel at, it's just that TI makes a specialized device for the same price. I imagine they (the Ice40's) are really for cases where you need some more I/O with a little glue in between, where cutting out those glue parts would save a lot of time, money, and space. It's still fun to tinker with/break little processors though ;)

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I've been learning Verilog over the past few months and a somewhat trivial question has been bugging me. Is there a reason to do declarations like this in Verilog:
code:
module rom(clk, addr, dout);
    input clk;
    input [7:0] addr;
    output [7:0] dout;
    reg [7:0] mem [255:0];

    initial begin
        $readmemh("file.hex", mem);
    end

    always @(posedge clk)
        dout <= mem[addr];
endmodule
... over this?
code:
module rom(
    input wire clk,
    input wire [7:0] addr,
    output reg [7:0] dout);

    reg [7:0] mem [255:0];

    initial begin
        $readmemh("file.hex", mem);
    end

    always @(posedge clk)
        dout <= mem[addr];
endmodule
I prefer the latter for no real reason, maybe because it seems easy to see who's driving who, and what resources get taken up? I think the majority of code I see uses the former, sometimes with variable white-spacing. Is there any sort of common white-spacing style in use? Heck, sometimes I see declarations in the order of whatever the author bothered to type first. I'd like to think that I understand digital logic well, so most of the 'gotchas' of the hardware description aspect I can grasp pretty quickly, it's just that I'd like other people to be able to read it without a lot of trouble.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Mr. Powers posted:

Here's a reason: You can't use a defparam in a parameter block, so if you want to calculate widths from maximums without putting $clog2's in all your definitions, you need to use the first style you have where you can declare your params and defparams before your interface types/sizes.

What I would prefer is to define input/output in the module declaration, and then size (if variable) below, but that causes ModelSim to barf (seems to want all or nothing in the declaration). I'm sure an experienced Verilog user would shudder at the way I do it, but it works for me.

Edit: wrote that on a phone and butchered it.

Makes sense, and explains why the manufacturer's ram example does it like that. I haven't messed with params much, just trying to make stuff work in eight bits and then I figured I'd shove 'em in once I got some good modules. Guess I'm gonna have to fix the old ones ...

I've been using Icarus Verilog and it'll eat anything apparently ...

I feel like it is inevitable that everything I write in Verilog would make at least one other Verilog user puke if they were to see it.

dougdrums fucked around with this message at 02:38 on Jan 12, 2016

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Aurium posted:

There's been some recent work to get an opensource setup for the Lattice iCE40. Not being a FPGA guy, I don't really know how finished it is, but it claims to be "feature complete (with the exception of timing analysis, which is work in progress)." Which you already noted as one of the major potential stumbling blocks.

https://media.ccc.de/v/32c3-7139-a_free_and_open_source_verilog-to-bitstream_flow_for_ice40_fpgas#video

This is what I've been using, everything has worked as expected. I think the PLL isn't supported, but I haven't tried to use it yet. Lattice's tools work fine too (and come with the dev board), but make is easier to use and I don't want to use a VM. The iCE40 line is all pretty tiny too, I'm thinking that may help.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I would do something other than write a generic OS for PC/x86. Three quarters of your time will be spent writing drivers that have already been written, not to mention your own libc with multitasking... Maybe take one part of the linux kernel like scheduling or the network stack, and get creative with it. That'll cover three semesters pretty easily.

If you're hellbent on making a whole OS, I've fancied making a pure 64 bit armv8 OS, but of course will never get to it.

I think if I was in your position, I'd design a some sort of stage lighting fixture. Iirc you said you wanted to focus on the EE and embedded side of things. It covers a good range of problems from driving LEDs to real-time networking. Optionally you can add some mechanical aspect if you wish. Flashing or blinking lights will impress people easily and keep you motivated.

Mr. Powers posted:

You should write an efficient and comprehensive readers-writer lock implementation for FreeRTOS and then contribute it back so I can use it.
This would be far more useful though... even if it doesn't blink anything.

dougdrums fucked around with this message at 10:29 on Oct 18, 2016

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I don't know what your goal is, or what in your house needs sensing, but what you're doing seems complicated. I think, in most cases, you should just run low voltage cable to dimmers, relays, or sensors. There are several entire industries that represent custom home automation, and they provide devices that are just as cheap and controllable. It doesn't take a whole lot of logical machinery to dim lights, or take sensor readings and write back feedback.

I feel like putting wireless devices in the walls will also cause some strange problems. Either way, I wouldn't put an uncased electronic devices in my walls due to fear of fire.

If I got a new place, I'd buy me a hefty machine just to control everything/store movies, and run gigabit ethernet everywhere.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Arachnamus posted:

Guys it's OK, I'm not a dumb dumb, I'm not going to tape an uncased arduino to a brick and plaster over it. I've not gone into detail on the installation of them because that's not the problem I'm trying to solve right now. They will be somewhere sensible, cased if appropriate, with some kind of panel access. But I do thank you for your concern.

Isn't it? I'm really confused ... I'm not sure how much is hyperbole, but you're talking about putting a $2 wireless microcontroller into a relatively expensive wall enclosure ...

I mean, I personally know and grew up with some people who design and work with these sort of systems. On occasion I have even worked with them, which is why I read this thread. I'm not insulting your intelligence; You're certainly aware that what you're requesting is strange, and possibly no poo poo dangerous. It's just that if you want household programmable led strip fart detectors or whatever to mess with, there are cheaper and simpler ways to do it that aren't exactly secrets.

Like there are so many reasons why they run AC power and ethernet instead of this. I mean y'all have been to a rock concert, right?

Couldn't you just get the outlets with 5v already built in, and just mount it on the wall like a thermostat? Or just mount them on the wall like thermostats? Or buy a modern hackable network thermostat?

dougdrums fucked around with this message at 04:11 on Jan 27, 2017

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
Netgear also makes a device called the EX2700 I think. It is small enough to fit in the palm of your hand, and comes with an AC supply attached. They can be modified to use powerline if you want. There are just so many better approaches to this.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I bought ten methane detectors a while ago in an effort to heat my house with grass clippings so you might understand why I'm so concerned about house fires.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I had a long rear end post typed out on my phone but I lost it so this is the brief version:

- Your request covers nearly every cheap dev board on the market.
- Powering the devices is the bulk of the installation problem, second is casing.
- You mention that you understand the details of the installation, but expressed a desire to run 5v DC power through your house, and then apparently make someone else do/check off on it... see the rs232 spec, phantom power, poe, etc.
- If you really want to use central DC power, use poe.
- Arduinos are meant for education or as a simple open template. It makes no sense to have a semipermanent arduino installation.
- I suggested the EX2700, a 802.11n device with a 500mhz processor and reasonably sturdy 5v supply that fits in your hand when disassembled. An openwrt image for these boards exists. It is < $30 usd.
- Generally speaking, the expensive part of home thermostats is the part where they control your hvac system. If you want to control your hvac, then it will run you about the same. It is cheaper than a junction box with a 5v supply in it ...
- If you just want to sense temperature, you don't need mcu's on your walls to do it.
- I once bought several name brand usb outlets for my office, took one apart, and lo it has the same decent switching regulator as everything else. I doubt that the mttf for it is really short enough to be a bother.
- You can apply the same reasoning to the esp8266. Besides a slew of stability problems, if the transmitter is damaged or the antenna breaks off, they continue to transmit, promptly catching fire.
- Electrical fires are no joke, especially to the people who may live in your home after you are gone.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Arachnamus posted:

I don't have a boner for any specific approach.
I suggest PoE because most of the "inbetween" details are solved by it, and then some, unless you are super intent on exploring how to run low voltage DC instead of doing fun things with mcus.

Arachnamus posted:

Is this a response to the other guy? I don't think I argued for or against USB outlets.
Yeah, my phone messed up and I was too lazy/short of time to put the quotes back in.

Arachnamus posted:

I didn't say I understood the details of the installation, I said I understood how to solve them when it comes time to even if that solution is "have a professional do it", whatever those needs are based on the best approach for the use case, whether that's 5V DC or 240V AC.
That's, like, a licensed electrician is going to make mostly the same points, and then bilk you for it. You're not solving anything. Sorry to be a dick, but being a software engineer, having some cash, and reading some articles doesn't mean you know how to solve everything. Like if you go to a real live electrician in person and say, "wire up all these mcus to a DC snake and run it through my walls to this panel", he is going to have a good story to tell his family over dinner ...

You're going to have to worry about the drop each device has on each loop, accidentally grounding this mess, powering the devices attached to the controllers (your DC loops are not going to power an led strip unless it's on its own circuit), and then you have this fat loving bundle carrying a fair amount of current that has to get to the power supply. This is off the top of my head from work I did years ago, and still when I did this sort of work a professional licensed electrician was standing by at all times, double checking and altering both my plans and implementation, because it's dangerous. Do you really want to bother with all that nonsense? I mean if you live in the free world and still want to do it, knock yourself out.

I just don't understand the benefit of doing this. I mean it sounds like you want some led strips along your floorboards, and maybe modulate them with the temperature or something and have some fun in the process. This can be accomplished with far less time, suffering, and expense by just about any other means.

quote:

How's that different to everything computers?

Let's call this to a close as it's kinda come off the rails. We all seem to be arguing and I'm not sure why. Thanks everyone who provided advice, I'll take it all on board, even the bits I don't necessarily agree with.

Embedded devices are meant to last for the life of the product, because they are embedded. In this case the product is your house. There is a (maybe exaggerated) reason that Union Pacific still operates VAX machines.

I think I'm the only one arguing really ... :sever:

dougdrums fucked around with this message at 19:38 on Jan 27, 2017

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

ante posted:

It doesn't have the same OTA update issues that 90% of microcontrollers have, because you just SSH in.

The great thing about the new ones is that the added some new features to the locked-down bootloader, so you can boot them straight from PXE iirc.

Adbot
ADBOT LOVES YOU

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

JawnV6 posted:

It's a lepton I won at a hackathon, we had a RPi talking to it over SPI. The kit came with an impressive little mounting board with a LCD screen and did the color-correction stuff, along with the module mount with the pin breakouts. I'm trying for something much smaller, got some knockoff ESP8266's that I *think* I can wrangle a SPI bus out of.
https://twitter.com/jawnv6/status/938450932395753472

It does, you've just gotta get a board without an antenna and forget.

The "AI Cloud Inside" refers to firmware updates from some arbitrary source, iirc. I imported a bunch of these and translated docs when they came out ...

dougdrums fucked around with this message at 21:58 on Mar 27, 2018

  • Locked thread