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
taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

Martytoof posted:

re: SPI: I'm imagining something like: integrating some other IC into the SPI mix which would have, say, five or six high pins, each connected to a separate SPI slave, then in my SPI communication routine I could feed the IC a command depending on which IC I wanted to talk to, and it would bring that particular slave low for communication. I'm just talking out my rear end though.

Sounds like you are asking for a latching shift register.

Adbot
ADBOT LOVES YOU

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

I'd like to make a composite USB device that acts as a virtual serial port and storage device. Lots of uCs will work for this, of course, but I was hoping someone here might have a recommendation for something with a good USB library or sample code. Cheapish dev tools would be cool.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

Delta-Wye posted:

If you want to go that way, the Linux usb gadget stuff in the kernel will provide that if you have a processor (arm, most likely) that will run linux.

The USB stuff is just going to be a configuration interface to an industrial device. The old version runs on a beefed up 8051 micro. I would prefer not to expand to something big enough to run Linux if I can help it. STM32F4 is what I'm looking at right now, and the Discovery dev board is cheap. But, Atmel actually has composite USB sample code and ST doesn't (that I can find).

vvv I probably wouldn't be much help. My project will need to be on our own HW and the storage will basically look like ROM to the end user and will be backed by the uC's internal flash.

taqueso fucked around with this message at 18:53 on Jun 28, 2013

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

Popete posted:

I asked in the Electronics thread but figured I'd throw it up here.

Does anyone know of a service that will place BGA components? I have an idea for a design using a Freescale K70, possibly with an eMMC both are BGA. I would need a service that does small (even single board) placement.

Advanced Assembly will do small runs like that, but you will pay handsomely for it. I bet there is a hobbiest level service somewhere, as in some guy on a forum with a DIY reflow oven, but I don't actually know of one.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

sliderule posted:

Well this saves me from debugging my 1/4 wave LUT with linear interpolation.

CMSIS has Q15 and Q31 LUT sin with cubic interpolation. I didn't have CMSIS, so I got it and hacked the Q15 sin file into a header. Unfortunately, I'm still getting crackling when modulating the depth, so either there's something wrong with my math or fixed-point FM is a lost cause.

I'd try the Q31, but I don't know if I'd really gain anything as I'd probably end up shifting away any of the extra resolution.

Can you make a test that runs through a bunch of inputs and saves the output of the sin function, then plot it and see if it looks like what you would expect?

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

I want to store a timestamp along with some data. What is best practice for the format? I'd prefer to keep it compact, but I'd also like to avoid rollover issues. Is 64-bit seconds or milliseconds past some epoch the way to go?

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

Thanks for the input.

The data is just position sensor readings that are being logged to flash. I have no expectation that this project will survive till 2038, but I'd still like to do the right thing in case it does. The data is for internal use only - I have control of the software that is responsible for interpreting the timestamps. If it was to be exported for some external tool, it could be transformed into a different format.

Currently, I am planning on writing a 256-byte flash page at a time, and each page will include a timestamp. I'd like each flash page to be usable without any of the other pages available.

The time/day info will be gathered from a bluetooth-connected cellphone, then tracked by internal RTC. I don't expect/need the timestamps to be super-accurate compared to walltime, but it would be nice to have millisecond resolution to be ensure that the pages can be ordered by time.

64-bit milliseconds since <epoch> seems to be pretty straightforward, unless I have to deal with it on a system that doesn't have support for 64-bit ints.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

ante posted:

The VHDL thread is dead, I guess, so this is the next best thing.


I have an Altium license through work. Would it be worthwhile to try FPGA development using that instead of ISE?

Xilinx's tools are stupidly clunky and aren't really well integrated, so it would be nice if Altium sidestepped all those issues.

I played around with it (a couple years ago) and it seemed to work well, if in a bit of a complicated way. I went back to the comfortable vendor toolchain for expediency and never bothered to try again. I think Altium can do what you want (sidestepping xilinx's toolchain) and you will be writing mostly the same HDL so you can bail pretty easily if it doesn't work out. I didn't care for the visual plug-together stuff, but that might have improved.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

Spatial posted:

Now I have a division question :)

I need to get the modulo of two 48-bit values. I have a 32-bit CPU with no divider. However I do have a fast hardware division peripheral which does 64-by-32, giving me a 64-bit quotient and 32-bit remainder. What kind of approach should I use to take advantage of that?

I tried a few things but I had no luck so far.

When I've had to do stuff like that before, I've usually been able to find some good info or at least something to get my brain in gear in The Art of Computer Programming. There is a big section on arithmetic algorithms.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:


Internet Janitor's Octo is really nice and polished, everyone should check it out if you haven't seen it before.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

If you look at the lines with a scope and/or logic analyzer, you can verify that the data you get in software matches what's on the line. If you can modify the hardware easily, you could disconnect MISO from the SPI device and watch the device's output pin with your scope/analyzer. Since it is disconnected from everything, you know any data you see there is coming from it. (Obviously the signal won't get to your uC while you are doing this test.)

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.

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.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

What happens when you send non protobuf data through the same pipe? Try sending more bytes than a packet, a small number of bytes, just a single packet, lots of packets really fast, etc and make sure the input and output match. According the the super quick reading on rfcomm I did, it is supposed to be reliable and emulate an RS232 port, so I wouldn't expect any extra data. Are you possibly running into a threading/synchronization issue? For example, reading a buffer while it is being written to.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

It's definitely 'normal' to run into problems like this :)

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

I thought some people might be interested in the 4th Octojam, taking place this month. It's a game jam targeting the Chip8 virtual machine from 1978. The platform is a fairly limited 8-bit machine with 12-bits of code space and 16-bits of data space if you use the extensions. It's a fun way to get down and dirty with some low-level code.

You can join the awfuljam discord to talk about it, someone there can probably answer your questions.

Internet Janitor posted:

I've been thinking about this. Might be worth adding a :suffix for such a purpose.

In other news, the Octojam IV page is together:


http://www.awfuljams.com/octojam-iv

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

Something like a teensy 3.2 is fairly high powered, has good software support (works like an Arduino but more powerful) and costs $20. Programming is over USB.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

The cool part is that you can improve all those aspects of your project as you learn more.

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

^^ and you could add a temp sensor for a few cents and with a little work compensate for temperature in software, too.

OP, I would recommend just making the clock display part first. You don't need to care if it loses time or is much less accurate below freezing. Hell, you don't care if it can track time at all if you have no way to show the result. Everything can be improved as you go, you will find out what you need to work on. Just make something first. Then see what could be better and make that part better.

Adbot
ADBOT LOVES YOU

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

A watch sized pcb design and build is totally possible for an amateur, but it would be the culmination of quite a few hours of learning and experimenting.

  • Locked thread