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
JawnV6
Jul 4, 2004

So hot ...
do it half & half

ISRs in verilog, bookkeeping app logic in asm

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...
im mad because my fun mathy way to kick a can down the road was voted down in favor of the proper solution

Jerry Bindle
May 16, 2003

JawnV6 posted:

im mad because my fun mathy way to kick a can down the road was voted down in favor of the proper solution

you should have just done it your way and built so much on top of if that by the time someone noticed they'd be too fatigued to even bring up the arguement

JawnV6
Jul 4, 2004

So hot ...
its less dev work for me right now, more bookkeeping during integration testing

i wanted to do more dev work and less unit tracking

movax
Aug 30, 2008

Bloody posted:

im thinkin about sticking a cpu core in my fpga because sending variable length strings over uart from verilog sounds like a horrendous pain in the rear end

softcore cpus are fun

Barnyard Protein posted:

agreed

also i feel like a dipshit calling myself an embedded engineer while there are people fuckin around with stuff this complicated in their spare time. i mean good lord, the amount of time i wasted loving around with uarts

i wouldnt feel bad, thinking about it, this is at heart a high-speed photodiode simulator. that honestly sounds boring as gently caress -- i need a cool project name, how can i start writing code or making project files / git repos if i don't have a project name!

Jerry Bindle
May 16, 2003
edit: not the place for work rants, sorry

Jerry Bindle fucked around with this message at 22:35 on Dec 14, 2015

Bloody
Mar 3, 2013

JawnV6 posted:

do it half & half

ISRs in verilog, bookkeeping app logic in asm

sounds like a deece idea

basically what im trying to do is build a debug/logging over serial port side channel into my hardware and doing it entirely in verilog sounds unpleasant

Bloody
Mar 3, 2013

i think ill probably just try to pack as much meaningful system state into as few bytes as possible, figure out a way to make position in the byte stream obvious, and just spam that out continuously over uart. definitely gonna take a lazy approach, like upper nibble is byte number, lower nibble is byte data, or base64, or something.

JawnV6
Jul 4, 2004

So hot ...
whoa there, "byte" stream? we're just going to give into those fascists who init on grouping up bits by 8?

Bloody
Mar 3, 2013

hell yeah

if it makes you feel better the other data link is 28 bits wide because the top 4 bits of the 32-bit wide bus inexplicably dont work

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!
lol

kind of like one of my first dmx dimming functions could only dim from the 100% to 0. couldn't start it at any other value for some raisin

movax
Aug 30, 2008

did you forget ground return wires so you needed a certain number of '0' in the data lines to act as a ground return?

parallel interfaces only, obv.

movax
Aug 30, 2008

also, every development board ever:

Sagebrush
Feb 26, 2012

saving that to put up on my classroom wall, tia

(i may make a proper cleaned up version)

Bloody
Mar 3, 2013

movax posted:

did you forget ground return wires so you needed a certain number of '0' in the data lines to act as a ground return?

parallel interfaces only, obv.

extremely lol

Bloody
Mar 3, 2013

movax posted:

also, every development board ever:



what do any of these scribblings say

Jerry Bindle
May 16, 2003
the best dev board i have just has a processor socket and a poo poo ton of I/O on 100mill header, plus a bunch of on-board peripherals that go ignored 100% of the time

Bloody
Mar 3, 2013

same but an fpga

Bloody
Mar 3, 2013

project members mocked me when i said "yeah break every unused fpga pin out to a bigass 0.1" header"

whos laughing now fuckers, thing owns

Sapozhnik
Jan 2, 2005

Nap Ghost
is there any sort of system-on-module solution similar to the Raspberry Pi compute module that isn't at least twice as goddamn expensive?

I mean I'll use the RPi module but surely there have to be some alternatives out there.

JawnV6
Jul 4, 2004

So hot ...
variscite dart board? idk if you can buy just one

some flavor of iMX might work as well

Sapozhnik
Jan 2, 2005

Nap Ghost

JawnV6 posted:

variscite dart board? idk if you can buy just one

some flavor of iMX might work as well

yeah variscite are all "contact a salesprick so we can figure out exactly how much we can screw you for". gently caress off, compete with the rpi module's price or don't waste my loving time.

all other modules are $100+ compared to the RPi CM's $40, I can't justify that at all. nobody is even remotely competitive.

Sapozhnik
Jan 2, 2005

Nap Ghost
https://www.olimex.com/Products/SOM/A20/A20-SOM-4GB/

Actually this looks kinda needs-suiting

bonus points, it's open hardware so we can always get a cm to build us more if olimex goes tits up

JawnV6
Jul 4, 2004

So hot ...
have fun working w/ an allwinner part

and never visiting a webpage without a variscite ad lol

Sapozhnik
Jan 2, 2005

Nap Ghost

JawnV6 posted:

have fun working w/ an allwinner part

and never visiting a webpage without a variscite ad lol

Webpages have ads? :confused:

Sapozhnik
Jan 2, 2005

Nap Ghost
The RPi2 we have jammed inside the case sometimes doesn't even boot up on power-on so if the A20 can do better than that it's already an improvement

Woolwich Bagnet
Apr 27, 2003



im tired of working with cypress peesocks and am looking to move on. im working on a design now that doesn't require immense throughput but in the future will require more than the 12 Mbit/s

ive been looking at TIs stuff and it seems pretty reasonable. 10/100 ethernet and high speed usb 2.0 would be nice, along with a million gpios all with interrupts. the 4 spi channels are nice since it will need a lot of extra ics.

anyone worked with then before/horror stories? i dont think im ready to try fpgas yet due to cost

Bloody
Mar 3, 2013

fpgas are horror stories so good choice

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Bloody posted:

fpgas are horror stories so good choice

fpga the 13th

The Eyes Have It
Feb 10, 2008

Third Eye Sees All
...snookums
Fuuuuck it's just one of those days can't get anything working :mad:

Like can't even get sample code from a project I found to work without dealing with compilation errors and constant little crap here and there, finally get it all working. Well, "running" anyway. It's outputting crap instead of actually working so all the payoff(?) of Yay it compiles finally and none of the benefit of knowing whether you're at 0 or 9/10 to something working yet

Been that way all week actually

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
I just cannot get the timing right for bit-banging this protocol via Arduino, even if I inline everything, go at the port directly instead of using digitalRead and digitalWrite, and wrap my little transmit and receive state machines in noInterrupts and interrupts

I feel like I'm not going to do much better in assembly either, when I look at the generated code, maybe I'd avoid a few pushes & pops around my timer ISR but I can't imagine those being that huge in overhead for a 100kbps protocol vs a 16MHz CPU

I figure I should just have a timer interrupt that looks a lot like this, which seems like it should fit in 160 cycles:

code:
volatile uint16_t txBuf = 0x0000;
volatile uint16_t rxBuf = 0x0000;
uint16_t tx = 0x0000;
uint16_t rx = 0x0000;
uint16_t txBit = 0;
uint16_t rxBit = 0;

void timerInterrupt(void) {
    if (txBuf && !tx) {
        tx = txBuf;
        txBuf = 0;
    }
    if (tx) {
        write_SO((tx >> (14 - txBit) & 0x0001); // macro of course
        txBit++;
        if (txBit > 14) {
            tx = 0x0000;
            txBit = 0;
        }
    }
    
    bool readValue = read_SI(); // macro of course
    if (rxBit == 0) {
        // only start reading on a start bit (always 0)
        if (readValue == false) {
            rxBit++;
        }
    } else {
        rx |= value << (14 - rxBit);
        rxBit++
        if (rxBit > 14) {
            rxBuf = rx; // yeah, just step on rxBuf
            rx = 0x0000;
            rxBit = 0;
        }
    }
}

and of course main loop code is writing to txBuf and reading from rxBuf

do I need to move to oversampling, and would 2× be sufficient? could something like the above really fit in less than 80 cycles?

or should I just bite the bullet and go to a faster board like the Due (which has a 48 MHz Cortex-M3) for something like this? I'd need to level shift between 3.3V and TTL then but I was thinking I could just use a transistor per channel for this, since the bus uses separate tx and rx lines

wish I could just use a goddamn on-chip UART but lol if there's a UART that can handle 15-bit frames at 100kbps (1 start, 12 payload, odd parity, 1 stop)

would I be better off just trying to adapt a real VHDL UART design and use a CPLD or FPGA? it seems like then I could plug together some pieces (UART, FIFO, SPI or I2C interface) and make everything easier on myself

or I suppose I could try some 74HCT logic: a couple latches, shift registers, etc. I could use a PWM from the Arduino for clocking data to and from the bus, while reading and writing could be done at a much more leisurely pace (and several bits at a time)

JawnV6
Jul 4, 2004

So hot ...
how sure are you of the 16mhz? not just that the clock settings are correct, are you actually within <1% of that?

uart needs better than 2% accuracy, so if it's based of an internal RC or something it's probably not working

add something that flips a pin at the end of each interrupt, scope it and see if it's running at the expected freq

JawnV6
Jul 4, 2004

So hot ...

eschaton posted:

just use a goddamn on-chip UART

Bloody
Mar 3, 2013

160 cycles should be plenty

Sagebrush
Feb 26, 2012

JawnV6
Jul 4, 2004

So hot ...

eschaton posted:

a UART that can handle 15-bit frames at 100kbps (1 start, 12 payload, odd parity, 1 stop)

you're talking to one, apparently? just use one of those chips

yippee cahier
Mar 28, 2005

use a gpio edge detection interrupt to kick off the timer interrupt so it begins sampling half a bit time later in the middle of the bit and you should be able to avoid oversampling. you'd probably have to decouple the transmit and receive functionality though.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

JawnV6 posted:

you're talking to one, apparently? just use one of those chips

unfortunately an HP 1RD2-6001 master link controller is pretty hard to come by these days (eg since the early 1990s)

also they're not just UARTs, they do more of the protocol implementation than that, so I can't just use an HP 1RC8-6000 slave link controller pulled from a peripheral (which can be found pretty easily, and I already have a bunch) as a workaround

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

sund posted:

use a gpio edge detection interrupt to kick off the timer interrupt so it begins sampling half a bit time later in the middle of the bit and you should be able to avoid oversampling. you'd probably have to decouple the transmit and receive functionality though.

thanks, that seems like a good thing to try

maybe I'll also try using a Due and oversampling, since 48 MHz and a 32-bit RISC CPU should give me a ton more room to be sloppy and still see something work

Adbot
ADBOT LOVES YOU

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

JawnV6 posted:

how sure are you of the 16mhz? not just that the clock settings are correct, are you actually within <1% of that?

uart needs better than 2% accuracy, so if it's based of an internal RC or something it's probably not working

huh, that's good to know, I have no idea but it's easy enough to figure out

the HP-HIL spec also turns out to mention that implementations need to support ±8%

quote:

add something that flips a pin at the end of each interrupt, scope it and see if it's running at the expected freq

this seems like great general hardware debugging advice

I was also considering either setting up a PWM or even just the CPU clock so my analyzer would have a clock signal to use in capturing a trace of what my device and the device I'm talking to are putting on the lines, and how terrible my timing really is

  • Locked thread