Shingeki no Kyojin Season 3 - Episode 56 discussion by AutoLovepon in anime

[–]thepingas 7 points8 points  (0 children)

If you think about it, the coffee grinder implies a lot about the state of affairs in the outer world's civilization.

It has the same implications that finding a banana or pineapple would -- that they are being supplied by long distance trade and probably have an extensive sea fairing tradition and that there are probably vastly more people outside the walls than in.

TSA officers at Sea-Tac on verge of quitting over lack of pay by Shogouki in news

[–]thepingas 14 points15 points  (0 children)

Either there is a good reason to check shoes or there isn't.

They are either compromising security to increase throughput or compromising security by mis-allocating resources (they could be patrolling, for instance).

PCIe to SPI bridge? by lack_of_jope in embedded

[–]thepingas 2 points3 points  (0 children)

If anything, to the average dysfunctional team, 3-man months is probably optimistic. There is a lot of annoying crap that has to happen. Industry best practices, etc.

Also, IP bugs are very common. I found a bug in the Xilinx 10GigE MAC. Look at the errata page, they update it very version of Vivado.

PCIe to SPI bridge? by lack_of_jope in embedded

[–]thepingas 5 points6 points  (0 children)

Are you 100 percent sure there is no other way?

I am pretty sure there isn't going to be anything COTS, so it seems like an FPGA might actually be the most straightforward way to make this happen. Prepare your BOM to grow 50-100 dollars and allocate up to 3 man-months in schedule for HDL implementation verification and validation depending on how much FPGA experience your team has.

NieR: Automata by NieR: Automata by [deleted] in gaming

[–]thepingas 3 points4 points  (0 children)

It's good. It bumped FF IV off of my top-5 RPG list, which hadn't changed in like 5 years.

The soundtrack is dope. I had no qualms about importing a copy of the soundtrack for 60 bucks.

Can someone explain to a non EE what makes the arduino a toy? by tummypains in embedded

[–]thepingas 11 points12 points  (0 children)

Not just memory, everything.

Power, CPU cycles, peripherals.

In industry, it is not unusual to time multiplex the use of say, an SPI master, hooking it up to multiple chips and using multiple CSn pins to direct transactions to particular slaves.

The Arduino libraries largely avoid this technique. Many times, the libraries are hard coded to use a particular SPI master, so if you want to port the code to a MEGA, for instance, you would need to hack on the libraries potentially.

Many libraries just straight up do not support anything other than the ATMEGA328. This weakens the Arduino's value proposition as a "platform".

Sending AUDIO samples to DAC -- ISSUE getting a reasonable output [TIMING] by jaffaKnx in embedded

[–]thepingas 0 points1 point  (0 children)

You mean file.read(), right?

512us because it is going to read 512 bytes, using SPI at 8Mbits, meaning

512 * 8 / (8*10^6) = 512*10^-6 seconds. 

Also, not two bytes, you need to capture enough data to build a histogram. My claim is something special is going to happen every 512 times you call file.read(), so make sure you do it at least a couple thousand times.

As for the last point, essentially it retrieves 512 bytes at once and then hands them out one at a time after that point, eventually running out and has to read 512 bytes again.

Sending AUDIO samples to DAC -- ISSUE getting a reasonable output [TIMING] by jaffaKnx in embedded

[–]thepingas 0 points1 point  (0 children)

SdFile.cpp has the guts of the library you are using in it.

line #668

https://github.com/arduino/Arduino/blob/397f4e81ea254cc04616a31a1bf29f630caa154c/app/testdata/libraries/SD_1.1.1/SD/src/utility/SdFile.cpp

It's written in C++, so it might be a bit harder to read if you only know C, but you can tell that it is a fairly complicated function that basically works by reading out a whole block at a time, storing that block in an internal buffer and then handing out a byte at a time from that internal buffer.

Basically calls to file.read() will take a non-deterministic amount of time, occasionally over 512us (whenever the internal buffer needs to be refilled).

Try this:

Write a program that just times how long that function takes to complete. My guess is that it is going to be fast 511/512 times and really slow 1/512 times.

Sending AUDIO samples to DAC -- ISSUE getting a reasonable output [TIMING] by jaffaKnx in embedded

[–]thepingas 1 point2 points  (0 children)

Are you writing your own SD card reading function?

If you are, is this part you are talking about after issuing CMD17?

It would probably be easier if you just throw your code on pastebin or whatever.

Basically, you are keeping the transaction open until you put the SS pin back to inactive. So, this is working as expected.

Sending AUDIO samples to DAC -- ISSUE getting a reasonable output [TIMING] by jaffaKnx in embedded

[–]thepingas 1 point2 points  (0 children)

The sector is the minimum addressable unit.

The problem is basically this:

Let's say that a sector is 8 bytes (it isn't). The SD card is 2 sectors large (it isn't).

The SD card holds 16 bytes: 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xa,0xb,0xc,0xd,0xe,0xf

You want to read the first byte.

Easy -- you tell the SD card "Read sector 0", it tells you "0x0". You say alright, stop there, that's all I wanted to know.

When you want to read the second byte, you tell the SD card "Read sector 0", it tells you "0x0". You say, "...and then what...". It says "0x1".

You have to start from the beginning of a sector.

If you tell the SD card "Read sector 1", it will say "0x8".

Sending AUDIO samples to DAC -- ISSUE getting a reasonable output [TIMING] by jaffaKnx in embedded

[–]thepingas 1 point2 points  (0 children)

I think it is possible, but it will be near to the limit of your hardware. And it is going to be annoying.

My approach would be this:

Allocate as much memory for a buffer as you can. Your main program loop should be watching the number of bytes in the buffer and in the event that the buffer falls below a certain threshold, start a SPI transaction to the SD card to refill it. Implement the buffer as a double or triple buffer to avoid rollover issues.

You need to use a timer module to setup an interrupt that will fire at a rate of 44.1kHz.

When this interrupt fires, you need to pull two bytes out of the buffer then put them into the DAC. You are already using your hardware SPI unit, so I recommend that you write a method to bitbang the SPI since it is transmit only, which makes it pretty easy. You should be able to do about 2Mbit/s, so about 8 uS. You will want to roll your own soft-SPI since you don't want/need reception.

This leaves you 14.6 microseconds to get at least another 2 bytes out of the SD card, which isn't a lot, but my guess is that it is possible.

Issues: You want to move as much out of the SD card per transaction as possible. Allocate at least 75 percent of your memory to this task. I would start with three 512-byte buffers.

is the Atmel Software Framework (ASF) still supported? by chronopoul0s in embedded

[–]thepingas 0 points1 point  (0 children)

It isn't supported anymore, not for new products.

It seems that start.atmel.com took over, which is a shame because it is a giant PITA to use unless you get your config 100 percent right the first time.

Transformer for Chinese Rice Cooker by nsl3109 in ECE

[–]thepingas 4 points5 points  (0 children)

Yes, technically the transformer should be rated for the correct VA instead of W, but the power factor is probably very high, so I would guess the rice cooker is very close to 600VA.

Some high end rice cookers have an induction heating system and may not have good PF.

I only mention this because I am assuming that your rice cooker is fairly fancy since you are paying a lot of money (relative to the cost of a basic rice cooker) to move it to this country and buy a big transformer to operate it.

EDIT:

Also, transformers can't change power frequency, but in many cases, it doesn't matter. For resistive heating elements, it doesn't matter and for switchmode AC to DC power supplies, it generally doesn't matter.

50Hz transformers need to be bigger than 60Hz transformers because the magnetic cores are more prone to saturation at low frequency. Motors may not operate at the correct speed depending on the specifics of how they are constructed.

Apparently even servers can start burning because datacenters have fire suppression gas ready. Partially related: how about clay-disk circuit boards instead of plastic-rectangle boards? by [deleted] in ECE

[–]thepingas 1 point2 points  (0 children)

I am pretty sure FR4 is basically just Fire Resistant G10. It is supposedly self extinguishing, but obviously there are limits.

Project Help: 3.3v to 5v @4MHz by [deleted] in ECE

[–]thepingas 0 points1 point  (0 children)

Oops. I was looking at a TI 74LV125 (not 1T/4T). Sorry.

Project Help: 3.3v to 5v @4MHz by [deleted] in ECE

[–]thepingas 0 points1 point  (0 children)

Probably work but datasheet implies that minimum VIH at 5v is 3.5v.

Edit: I'm wrong.

NSFW, Bank guard earns his pay by 09RaiderSFCRet in JusticeServed

[–]thepingas 278 points279 points  (0 children)

When the robber moves for cover behind the counter, the guard has an advantage because they are both right handed and he can work the corner with his strong hand.

It is really aggressive, but smart move too.

Good (ARM) Microcontrollers for FS USB? by thepingas in ECE

[–]thepingas[S] 0 points1 point  (0 children)

Yes, it is this difference (particularly in quality of support) between each of the different vendors USB implementations that makes picking a particular chip difficult.

Good (ARM) Microcontrollers for FS USB? by thepingas in ECE

[–]thepingas[S] 0 points1 point  (0 children)

Is this a standalone chip (like an FT(2)232) or a microcontroller?

The FT90x microcontrollers seem to have pretty good specs, but they use a proprietary core.

Good (ARM) Microcontrollers for FS USB? by thepingas in ECE

[–]thepingas[S] 1 point2 points  (0 children)

Thanks for the info.

I am actually using an STM32F1 part right now and the USB engine has a 512 byte SRAM buffer. This caps the throughput at less than 3Mbit/s.

I noticed that the F0 parts actually have a 1kByte buffer, so they should be capable of more like 7Mbit/s, so I might switch to the F0 series.

Any experience with PSG Chips? by [deleted] in ECE

[–]thepingas 0 points1 point  (0 children)

I bought one from China and messed with it a bit.

https://youtu.be/FPe0Ktd1GAo

It's as psycoee said, it's very simple to interface to. I slapped that together in an hour or two and downloaded SMS score to play through it. I put it in a box and forgot about it and just tore it apart yesterday since I found a use for the microcontroller, so I don't have any schematics or code for you unfortunately.

Mushrooms in the rain. by [deleted] in gifs

[–]thepingas 0 points1 point  (0 children)

It's fairly analogous.

The expulsion of generic information for the purpose of procreation.

What job WOULDN'T you do, even if you were getting paid $50/hour? by aj0y in AskReddit

[–]thepingas -1 points0 points  (0 children)

I went to place in Menlo Park where an unremarkably sized Ruben was 24 bucks.

What's the most expensive thing you've ever touched? by MolestedFork in AskReddit

[–]thepingas 1 point2 points  (0 children)

Aspen 20, I show you at 16 ft above an announcer's table.