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
carticket
Jun 28, 2005

white and gold.

JawnV6 posted:

A ring buffer where an empty entry to make the accounting simpler is a good space tradeoff.

Are you saying storing n-1 entries in an n sized ring buffer to avoid the duality of head=tail?

Adbot
ADBOT LOVES YOU

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

peepsalot posted:

Whats an embedded data structure?

I think he means a data structure library aimed at embedded use. In my mind, that would be a lib that doesn't use malloc and expects the caller to do allocation. Or something based on adding to the user's data structure, like uthash/utlist. I'd be interested in hearing what people like, because I've been reinventing various wheels as needed.

yippee cahier
Mar 28, 2005

taqueso posted:

I think he means a data structure library aimed at embedded use. In my mind, that would be a lib that doesn't use malloc and expects the caller to do allocation. Or something based on adding to the user's data structure, like uthash/utlist. I'd be interested in hearing what people like, because I've been reinventing various wheels as needed.

Yes, exactly. With attention given to memory use as well.

I was eyeing http://liblfds.org/ but it targets desktop platforms, so I'd have to do a bit of work and didn't know if I was overlooking something.

carticket
Jun 28, 2005

white and gold.

I was in a schematic review today and realized the net name for my CPUs active low power on reset was "PORN".

qsvui
Aug 23, 2003
some crazy thing
That reminds me of coming across "SEXT" in a textbook about digital design.

carticket
Jun 28, 2005

white and gold.

Sexting those negs. Playing the game.

Popete
Oct 6, 2009

This will make sure you don't suggest to the KDz
That he should grow greens instead of crushing on MCs

Grimey Drawer
U-Boot serial output lists the reboot type as: [PORN]

Me: Heh...

minidracula
Dec 22, 2007

boo woo boo
So is it just me, or did TI just make Code Composer Studio tools free for use (under their "Technology/Software Publicly Available" license terms) for not only the newly-released CCS 7, but also version 6 and previous? Based on what I can find from some TI pages, including a sticky post in the CCS forum on their e2e.ti.com site, and the "Download CCS" wiki page on processors.wiki.ti.com, it seems like that's exactly what they did. And they did it like last week/this week, if some of these dates I'm seeing are to be believed. The license file for CCS 6 they link to from the same wiki page seems to work in CCS 6, but it almost sounds too good to be true. If so, it happens to be really fortuitous timing for me.

Anyone else able to confirm?

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun
Does anyone know how robust Rust support for these sorts of systems is? I'd strongly prefer not to write C

Also, would the Arduino be capable of driving a colored LED array and doing audio synthesis at the same time? Trying to keep the system as minimal as possible, because A. restrictions create creativity, and B. I want to muck around with OS stuff as little as possible.

Captain Cool
Oct 23, 2004

This is a song about messin' with people who've been messin' with you

Ghost of Reagan Past posted:

Does anyone know how robust Rust support for these sorts of systems is? I'd strongly prefer not to write C

Also, would the Arduino be capable of driving a colored LED array and doing audio synthesis at the same time? Trying to keep the system as minimal as possible, because A. restrictions create creativity, and B. I want to muck around with OS stuff as little as possible.
It depends on the size and refresh rate of the array and what you mean by audio synthesis, but I'm going to say it will be tight. Do the math and see how many cycles you have for each LED and each audio sample. And keep in mind the limited memory space -- you won't be able to store images or audio samples of any decent size.

I'm not familiar with Rust, but if you're using things like threading and polymorphism, you will have more overhead and less visibility into how many cycles you're using.

Captain Cool fucked around with this message at 00:04 on Dec 22, 2016

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
I don't know what your constraints & requirements are, but for audio synthesis I'd strongly prefer a Teensy instead of an Arduino. Is that an option?

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun
It's an art project I want to do, so my requirements are that it be fun to build and that I don't get boxed in by hardware incapable of handling what I want to do (which is wildly underspecified at this time).

I might be using samples, or I might want to create sounds on the fly, I'm unsure yet. So yes, a Teensy is an option, but I'm not sure what a Teensy is.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

There's also some shields you can get that let you put samples on an SD card and play them with SPI commands.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

Rust is at the point where you could probably use it, but it will add a thick layer of complication and fiddly-ness. Embedded rust is more 'in active development' than 'ready for prime time'. I wouldn't recommend it if you don't have prior embedded experience, or you will spend a lot of effort just to get started.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Hello embedded friends, I hope this is the right place to ask. I read the first page and it looked like things were mostly similar to what I'm looking for.

I work at a high-end commercial coffee/espresso retailer, and we need to upgrade a machine. We've been told (in broken English, from Italy) by the manufacturer that we need AVR Studio (already downloading) and one of these to do so:
https://www.amazon.ca/WaveShare-USB-AVRISP-XPII-Compatible/dp/B00KM6ZA9I/

An AVR ISP MKII USB -> 10 pin connector.

1) Do any of you know of a reliable >Canadian< source for one? The impression I get is this hardware is somewhat obsolete and I'm having trouble finding it in stock locally. Related question is:

2) Does it >have< to be this device, or will any similar adapter/interface do? E.g. something like this https://www.amazon.ca/uxcell-USBtinyISP-USBTiny-Programmer-Bootloader/dp/B00VGDYPOW/

Thanks in advance for any answers! Sorry to pull the typical "never post in the thread and drive by asking a dumb question" play.

EpicCodeMonkey
Feb 19, 2011
AVR Studio, as opposed to Atmel Studio, implies that it's a crusty old project (the latter replaced the former several years ago). AVR Studo has very limited programmer device support, so an AVR ISP MKii or one of the many clones that use my firmware will work natively.

However, if they are just giving you a HEX, ELF or other binary it doesn't matter what application and programmer device you use. What exactly have they given you to program into the device? Even if it's a source project for the old AVR Studio application you can still compile with hat then use a modern app and programmer to flash it I to the target.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Thanks for responding; as you can tell this is my first exposure to this kind of thing. I had gotten the impression this stuff was out of date; the way we're upgrading this machine is replacing the entire front plate with a touchscreen, the interface its replacing is an 8 button analog system. So I need to upgrade the main board so it "knows" about the new face plate.

I grabbed the update that's going in and it's just this:
code:
Lcd128B-410A.hex
Lcd128CIR-410A.hex
Lcd128DK-410A.hex
Lcd128E-410A.hex
Lcd128J-410A.hex
Lcd128NO-410A.hex
Lcd128P-410A.hex
master256-410A.hex
So you're saying in this case any old interface will do? E.g. the hex files will copy over automatic like without having to manage it from an external application like AVR Studio?

Scaramouche fucked around with this message at 21:01 on Dec 21, 2016

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Sorry for the mass posting, but I just got off the phone with a robotics guy. He says the one they suggested (ATAVRISP2) is actually no longer being manufactured, and (gulp) might be the only thing that will work, depending on if the hardware is tinyAVR or megaAVR. Or figure out if the ATJAGICE2 might work I guess.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Oh lord it's an ATMEGA256RFR2. Think I might just go with a Bus Pirate w/10 pin cable.

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

Luigi Thirty posted:

There's also some shields you can get that let you put samples on an SD card and play them with SPI commands.
Interesting but since I don't know what my plans are I'd rather not lock myself into that approach. Hell, for all I know I'll hook it up to an analog synth.

I would guess something a bit more powerful than an Arduino is probably where I should aim if I'm not 100% clear on what I'm building, then.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

Ghost of Reagan Past posted:

Interesting but since I don't know what my plans are I'd rather not lock myself into that approach. Hell, for all I know I'll hook it up to an analog synth.

I would guess something a bit more powerful than an Arduino is probably where I should aim if I'm not 100% clear on what I'm building, then.

Relatively high level language? LED display? Audio? Underspecified hardware? Sounds like the Beaglebone Black or Green are the things for you.

EpicCodeMonkey
Feb 19, 2011

Scaramouche posted:

Sorry for the mass posting, but I just got off the phone with a robotics guy. He says the one they suggested (ATAVRISP2) is actually no longer being manufactured, and (gulp) might be the only thing that will work, depending on if the hardware is tinyAVR or megaAVR. Or figure out if the ATJAGICE2 might work I guess.

You can pretty much use any programmer then, third party or official. The hex files are the compiled application binaries and the 8-bit AVRs all speak the same ISP programming protocol, so pick and choose what you like.

AVRDUDE and a third party clone programmer would do, as would any AVR programmer or JTAG Atmel currently produce. Hell, you can use an Arduino as an ISP device.

Popete
Oct 6, 2009

This will make sure you don't suggest to the KDz
That he should grow greens instead of crushing on MCs

Grimey Drawer
You can just grab whatever latest Atmel Studio is (I think 7?) from Atmels website. There is drop down Tools->Device Programming from the top bar where you can load arbitrary hex files onto a board that it detects. Did they specify which of the hex files you need to load onto the board?

Another thing to note, is there a 6 pin header somewhere on the board? If the programming pins aren't broken out to a header then you might have to figure out how to get at those pins. The header will look something like these highlighted red boxes (may or may not have the pins soldered onto the board).



I just want to note that this is a very bizarre upgrade process, is this just a couple guys in their garage selling a 3rd party add on for a coffee machine?

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

It's an actual complete commercial coffee machine, I don't have access to the broken out boards by themselves (see attached image). There is a 10 pin connector behind that front button panel that I'll have to connect to using the AVRISP2, and the board itself is buried somewhere inside the machine on the left behind the boiler. The LCD display at the top and the buttons are run from an ATMEGA128 (which I can ignore because I'm replacing), and the boiler/pump/grinder stuff is controlled by an ATMEGA256. Unfortunately I'm not at the point where I can even run Atmel Studio since I need an interface to connect with whatever proprietary way they wired up that header. Based on some speedy learning and help from this thread I'm either going to:
A)Wait for the AVRISP2 they're sending us from Italy to arrive, use Atmel Studio to copy over the Hex. They've already sent me the instructions and it's basically what you say above.
B)Get adventurous and buy a Bus Pirate w/ 10 pin debug cable, hope I can get the Windows 10 drivers working, and use AVRDUDE to get it over

So at this point I'm pretty well "set" with either solution, just need to either wait on the interface or not, and luckily it's not an urgent matter.

It's actually a pretty Big Deal company in Europe; that machine costs about $9,000 and can server over 100 cups of coffee per hour.

Only registered members can see post attachments!

Spatial
Nov 15, 2007

I spent all of yesterday trying to get a SPI peripheral to talk with a device. drat, it should be easy right? That's why it's a peripheral. But I couldn't get it to work no matter what I tried. The SPI peripheral is practically impossible to debug because you can't see into the TX/RX FIFOs and reading the status registers clears them. Example code didn't work, and did things which according to the SPI documentation should result in no bus activity (non-clearing FIFO flush flags always set, etc).

Also, I don't have an oscilloscope or logic analyser. :v:

Today I made it work in 45 minutes by straight up writing the protocol in assembly language bitbanging with one eye on the timing diagram. BAM. I feel proud, but gently caress the peripheral right up the butt for being harder to use than nothing at all.

Pan Et Circenses
Nov 2, 2009

Spatial posted:

Also, I don't have an oscilloscope or logic analyser. :v:

This is any embedded systems person's first and last mistake. You need to see your signals. Depressingly many embedded systems do not even perform to spec, let alone how you'd expect them to. USB logic analyzers are so cheap these days it's just silly not to have one, unless you like banging your head against buggy silicon for 8 hours.

Jaded Burnout
Jul 10, 2004


I'm a programmer with a house in need of renovation and you know what that means: microcontrollers in all the walls.

I'm trying to find the best combination of small, cheap, relatively easy to wire (I'm comfortable with solder), and it's gotta be on the network, either wired or wifi (but wifi for preference).

I've done a lot of digging and the usual suspects (RPi and CHIP) suffer from stock shortages and limited per-person orders.

Looking into arduino always confuses the heck out of me because there's so many forms of chips and boards, but boards with the ESP8266 chip look like what I should be going for?

They're going to be put to a number of simple uses like thermometers, LED controllers, etc, so I'm not exactly sure how many GPIO pins I need but I believe I need at least 3 to control the MOSFETs for RGB LED strips which rules out one of the more popular ESP8266 boards I've seen.

Could you point me in the right direction here?

Popete
Oct 6, 2009

This will make sure you don't suggest to the KDz
That he should grow greens instead of crushing on MCs

Grimey Drawer

Arachnamus posted:

I'm a programmer with a house in need of renovation and you know what that means: microcontrollers in all the walls.

I'm trying to find the best combination of small, cheap, relatively easy to wire (I'm comfortable with solder), and it's gotta be on the network, either wired or wifi (but wifi for preference).

I've done a lot of digging and the usual suspects (RPi and CHIP) suffer from stock shortages and limited per-person orders.

Looking into arduino always confuses the heck out of me because there's so many forms of chips and boards, but boards with the ESP8266 chip look like what I should be going for?

They're going to be put to a number of simple uses like thermometers, LED controllers, etc, so I'm not exactly sure how many GPIO pins I need but I believe I need at least 3 to control the MOSFETs for RGB LED strips which rules out one of the more popular ESP8266 boards I've seen.

Could you point me in the right direction here?

If you're ambitious you could make your own boards. I love AVR chips and usually when I have project in mind I will take a base existing Arduino board schematic and use that as a template for building my own. Add on GPIO expanders and IO ports as needed, plop down Bluetooth/wifi chips that are commonly found on Arduino shields etc. If you're handy with a soldering iron once you get a working prototype it's cheap enough to get a dozen PCBs and build them up as needed.

fritz
Jul 26, 2003

Popete posted:

If you're ambitious you could make your own boards.

What an excellent way to surprise the next owner!

Aurium
Oct 10, 2010

fritz posted:

What an excellent way to surprise the next owner!

I hope they're paranoid about being spied on.

JawnV6
Jul 4, 2004

So hot ...
Wire ethernet everywhere, but what's the use case for a SBC embedded in the wall? Need to power them somehow, need physical access for any GPIO usage and probably need for any hard reset.

Jaded Burnout
Jul 10, 2004


Popete posted:

If you're ambitious you could make your own boards. I love AVR chips and usually when I have project in mind I will take a base existing Arduino board schematic and use that as a template for building my own. Add on GPIO expanders and IO ports as needed, plop down Bluetooth/wifi chips that are commonly found on Arduino shields etc. If you're handy with a soldering iron once you get a working prototype it's cheap enough to get a dozen PCBs and build them up as needed.

This might be beyond my ability, I'm afraid.

JawnV6 posted:

Wire ethernet everywhere, but what's the use case for a SBC embedded in the wall? Need to power them somehow, need physical access for any GPIO usage and probably need for any hard reset.

Take the "in the walls" part as hyperbole, but the intent is a central server doing the heavy lifting with these devices acting as local controllers for the necessary sensors and lights and such.

There will be wired ethernet everywhere, though wifi is a preference because it reduces the number of runs I'll need to provide and the size of the patch panel / switching.

The infrastructure and software I can solve, it's the vast world of arduino hardware that has me lost.

Aurium
Oct 10, 2010

Arachnamus posted:

This might be beyond my ability, I'm afraid.


Take the "in the walls" part as hyperbole, but the intent is a central server doing the heavy lifting with these devices acting as local controllers for the necessary sensors and lights and such.

There will be wired ethernet everywhere, though wifi is a preference because it reduces the number of runs I'll need to provide and the size of the patch panel / switching.

The infrastructure and software I can solve, it's the vast world of arduino hardware that has me lost.

I'd recommend the adafruit huzzah. Native wifi. Cheap. Adafruit has tons of tutorials to get it working with various sensors. Able to be programmed in the arduino environment.

You would need a separate usb-> ttl serial board. (https://www.adafruit.com/products/3309) ~$6 though adafruit.

This one has the usb built in, but it's out of stock (and +$5 each board, which would add up quickly)

JawnV6
Jul 4, 2004

So hot ...

Arachnamus posted:

Take the "in the walls" part as hyperbole, but the intent is a central server doing the heavy lifting with these devices acting as local controllers for the necessary sensors and lights and such.

There will be wired ethernet everywhere, though wifi is a preference because it reduces the number of runs I'll need to provide and the size of the patch panel / switching.

The infrastructure and software I can solve, it's the vast world of arduino hardware that has me lost.
You opened the whole thing as being related to the renovation, if they're not living in the walls I don't really follow. You still need to get power out to them so selecting a wall socket with native USB out would help.

PoE can provide both power and data if you've specced for it.

Star War Sex Parrot
Oct 2, 2003

JawnV6 posted:

PoE can provide both power and data
What embedded platforms support this?

JawnV6
Jul 4, 2004

So hot ...

Star War Sex Parrot posted:

What embedded platforms support this?

Native? No clue. With a PoE splitter? Any SBC with a RJ45.

Star War Sex Parrot
Oct 2, 2003

JawnV6 posted:

With a PoE splitter? Any SBC with a RJ45.
Well that's not fun at all.

Jaded Burnout
Jul 10, 2004


JawnV6 posted:

You opened the whole thing as being related to the renovation, if they're not living in the walls I don't really follow. You still need to get power out to them so selecting a wall socket with native USB out would help.

PoE can provide both power and data if you've specced for it.

Yeah sorry I must not be being clear. They will be in the walls or ceilings or skirting boards, I haven't decided yet and it'll likely change depending on use, but getting power to them isn't a concern because the house is getting a whole new set of electrical wiring, and I can sort sockets as needed, plus I'm not against running a DC ring if that makes sense.

The thing I'm getting at is that I'm comfortable solving infrastructure issues like data, electricity, cabling, and maintenance access, it's just the hardware that I'm looking for help with.

Aurium posted:

I'd recommend the adafruit huzzah. Native wifi. Cheap. Adafruit has tons of tutorials to get it working with various sensors. Able to be programmed in the arduino environment.

This is very promising indeed, thank you. Adafruit have always provided good documentation for their stuff and their UK availability is not bad. Nice.

csammis
Aug 26, 2003

Mental Institution

Arachnamus posted:

They will be in the walls or ceilings or skirting boards

I really don't want to discourage creativity but f I were buying a house and I saw "bespoke smart home system designed by current owner, by the way you'll have to tear the house apart to remove or fix it" on a seller's disclosure - you would disclose that, right, and not just leave a letter for the new owners on closing day? - I'd run so loving fast the realtor would get wind chapped. Maybe you're not worried about or thinking about resale value right now but consider what JawnV6 said about physical access to the boards for changes / maintenance that you'll be doing. Do you really want to tear up a skirting board to fix a loose wire, then nail it back down and repaint? I'll go out on a limb and say that no, you don't.

If I were renovating a house and wanted to get creative with the hacker-friendly amenities, I'd run a 5V DC ring and the fastest Ethernet available to empty 2-gang boxes in every room of the house. That way you have a nice little niche everywhere to put your microcontroller projects that isn't a permanent installation or hard to access.

Adbot
ADBOT LOVES YOU

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.

  • Locked thread