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
gonadic io
Feb 16, 2011

>>=

JawnV6 posted:

im not sure how to set your problem up, but i'd imagine it's measuring degrees off the vertical. "if i'm over 2 degrees the wrong way, fire the solenoid" is the problem statement? forget about time for now, how precise do you need the degree measurement to be?

p much yeah, and i have no idea :v: i'm just copying that paper mostly. once i have anything working, in about 10 years, i'll look to lower the price.

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
https://www.arduino.cc/en/Tutorial/Potentiometer

why this tutorial say to connect 1 pin with ground, one with the board, and then 1 to +V?

surely the same effect is achieved with enabling the internal pullup resistor, then connecting it to the middle pin then connecting ground to either of the side ones?

Sweevo
Nov 8, 2007

i sometimes throw cables away

i mean straight into the bin without spending 10+ years in the box of might-come-in-handy-someday first

im a fucking monster

if you connect both ends of the potentiometer to ground then the mid point will always be ground regardless of where you turn it.

gonadic io
Feb 16, 2011

>>=

Sweevo posted:

if you connect both ends of the potentiometer to ground then the mid point will always be ground regardless of where you turn it.

i get that, what i'm asking is the diff between

code:
     pin
      |
0V ---|-- 5V
and
code:
  pulledup pin (+5V)
      |
0V ---|--- (disconnected)

Bloody
Mar 3, 2013

the goal is to use the pot as a voltage divider presumably. if you just pull up the middle of the pot you have... something. not a voltage divider. well at least not a useful voltage divider

gonadic io
Feb 16, 2011

>>=

Bloody posted:

the goal is to use the pot as a voltage divider presumably. if you just pull up the middle of the pot you have... something. not a voltage divider. well at least not a useful voltage divider

i see, it goes between 0 and 5 with all three pins connected.

with just the middle you have something that goes between x and y where 0 < x < y < 5 and they both depend on the exact resistors involved

Bloody
Mar 3, 2013

assuming you can enable the adc input and the pull up resistor at the same time then yeah

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

gonadic io posted:

i see, it goes between 0 and 5 with all three pins connected.

with just the middle you have something that goes between x and y where 0 < x < y < 5 and they both depend on the exact resistors involved

well, it'd go 0 < y < 5 tbh. the circuit
pre:
    v0
     |
    R1
    ----- vout
    R2
     |
   gnd
is analyzed by noting that the current through there will be v0/(R1+R2) from ohm's law; and then saying that the voltage across R2, which is what you're measuring, will be that ((v0/(R1+R2)) * R2. in your setup, R1 is the internal pullup resistor. its value should be in the device datasheet for the chip the arduino uses. R2 would be the voltage between the pot wiper and ground, which will vary based on the position of the wiper. if the wiper is near one edge, that will be 0 resistance and you'll measure 0 voltage. at the other end, it will be the resistance of the potentiometer and you'll measure 5V * (pot resistance / (pot resistance + pullup)).

if you connect the potentiometer like the datasheet says, it's a slightly different situation because r1+r2 = some constant resistance always, so you can actually get all the way up to 5V as well as down to 0.

also like bloody says you may not be able to enable that pullup and the adc at the same time.

Bloody
Mar 3, 2013

the 0 x y 5 case was the hypothetical one with the pull up n poo poo

Captain Foo
May 11, 2004

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

Bloody posted:

the 0 x y 5 case was the hypothetical one with the pull up n poo poo

More like 4 x y 20 lmao

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.

gonadic io posted:



gently caress 2mm pitch pins.

Also what are we counting as "crazy expensive aviation" ones? These are £90 each,and I am eventually planning on using them in aviation.

Hed
Mar 31, 2004

Fun Shoe
I think hardware RE seems really cool--that 33c3 talk on hacking pay-tv authorization / encryption was eye opening as an end-to-end display of ability. Are there any starter things for hardware hacking like there is CTF for software? Trying to think of some fun stuff to plug a JTAG or logic analyzer into that would be a good noob project.

hifi
Jul 25, 2012

Hed posted:

I think hardware RE seems really cool--that 33c3 talk on hacking pay-tv authorization / encryption was eye opening as an end-to-end display of ability. Are there any starter things for hardware hacking like there is CTF for software? Trying to think of some fun stuff to plug a JTAG or logic analyzer into that would be a good noob project.

the bunnie book about the xbox is cool. it goes over some beginner stuff and also some stuff like tapping into the HT bus but it's also an interesting read regardless of your expertise, sort of like watching any of the youtube hardware channels. you can get it for free too http://bunniefoo.com/nostarch/HackingTheXbox_Free.pdf

edit: sorry, i actually read your post

- dump cartridge video games
- routers
- convert a oldass keyboard to usb with like a teensy

hifi fucked around with this message at 03:30 on Feb 20, 2017

yippee cahier
Mar 28, 2005


so cool. i used to handle LN-200 IMUs while working at an aviation company but never saw an open one.

spankmeister
Jun 15, 2008






Hed posted:

I think hardware RE seems really cool--that 33c3 talk on hacking pay-tv authorization / encryption was eye opening as an end-to-end display of ability. Are there any starter things for hardware hacking like there is CTF for software? Trying to think of some fun stuff to plug a JTAG or logic analyzer into that would be a good noob project.

Theres a company here in the Netherlands called Riscure thats one of the leading ones in the field afaik and they do a ctf every year where they mail you a raspberry pi arduino nano that they put a secure image on but with some vulns.

I had the opportunity to play with some of their equipment last week, voltagr glitching a smarcard, and it owns major bones.

e: http://rhme.riscure.com/home

spankmeister fucked around with this message at 18:17 on Feb 20, 2017

Hed
Mar 31, 2004

Fun Shoe
Thanks for the book link and the ideas guys. I will definitely check out the next CTF from that place.

Wanna get that green glitcher :fap:

gonadic io
Feb 16, 2011

>>=
Bah, still having issues with Rust and my Arduino. Anybody want to weigh in? http://stackoverflow.com/questions/42368675/why-does-getting-the-address-of-certain-linker-variables-halt-samd21-execution-i

Honestly at this point I'm not far off just creating a dynamic library in Rust and doing the setup in C to call the Rust library.

JawnV6
Jul 4, 2004

So hot ...
at some point you'll have to read asm. if you've minimized it down to that one line, figure out what assembly is being generated from it

one of the common tricks is to use a "b .", in C i'd write:
__asm("b .")

with volatility or memory clobber if the compiler was getting too clever with it. that opcode says "jump to the beginning of this instruction" so when the processor hits it, it'll spin right there until you interrupt with the debugger. from there you can manually adjust the PC and step over the instruction to see when the fault happens. put one right before your attempt to grab the etext

my guess, based on kinda scanning the SO, is that rust isn't letting you see/touch that pointer and is subbing in some garbage value like 0x0 that's causing a DATA ABORT

longview
Dec 25, 2006

heh.
what is a good ide to use with STM32 mcus?

arduino due is a very comfortable environment but i can't ignore how ridiculously cheap the stm32f103c8 is so i ordered some eval boards and a cheap programmer in case the UART bootloader doesn't work

JawnV6
Jul 4, 2004

So hot ...
avoid The CUBE at all costs

vim/emacs would be better

hobbesmaster
Jan 28, 2008

longview posted:

what is a good ide to use with STM32 mcus?

arduino due is a very comfortable environment but i can't ignore how ridiculously cheap the stm32f103c8 is so i ordered some eval boards and a cheap programmer in case the UART bootloader doesn't work

eclipse is ok, there's ARM gcc and openocd plugins that work as well as any other embedded tool chain (that is to say, finicky) http://gnuarmeclipse.github.io


by eval board did you mean a nucleo board? if thats the case use the mbed online compiler until you hate it enough to spend an afternoon setting up toolchains

big shtick energy
May 27, 2004


hobbesmaster posted:

eclipse is ok, there's ARM gcc and openocd plugins that work as well as any other embedded tool chain (that is to say, finicky) http://gnuarmeclipse.github.io


by eval board did you mean a nucleo board? if thats the case use the mbed online compiler until you hate it enough to spend an afternoon setting up toolchains

Yeah the eclipse/GCC toolchain is pretty great. Also grab the drivers from the STMCube, they seem to work just fine

longview
Dec 25, 2006

heh.
Alright, I'll give Eclipse + extensions a try, thanks guys.
though i might also see if the stm32 arduino port works at all, mostly depends on how much work it is to set up a graphics library with the normal ARM libraries.

for my eval board i just ordered some of these: https://www.aliexpress.com/item/STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-Arduino/32279776568.html
really basic stuff that i should be able to put on a bread board to get the feel for the platform.

i'm planning on rolling my own board initially to convert some old panasonic car-phones into 430 MHz ham radios, i need to drive an OLED display and maybe do a bit of tone generation with PWM so not doing anything really special. if it wasn't for the OLED display i could probably fit most of the functionality in an atmega328 or two.

but if i can get it running without too many tears i'll probably use the chip for lots of other things since it's so nice to have enough ram to buffer at least an entire 128x64 mono display + be able to use floating point where needed without taking several ms per calculation

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.
i want to reverse engineer one specific thing

I have an old Japanese maritime weatherfax receiver that uses metallized recording paper and an electric stylus to print out wefaxes, but the "zones" and "stations" and "channels" are all hardcoded. I opened it up hoping for potentiometers or something and found it's stuffed full of dozens of ICs and either one or two ROMs (IIRC) plus all the analog parts

no idea what even architecture it is

Sapozhnik
Jan 2, 2005

Nap Ghost
google the part numbers on the silkscreens

a lot of it might also be something from this list:

https://en.wikipedia.org/wiki/List_of_7400_series_integrated_circuits

longview
Dec 25, 2006

heh.
some old designs used ROMs as gate arrays/lookup tables so if all you find is ROMs + standard logic that might be what they're doing

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.

longview posted:

some old designs used ROMs as gate arrays/lookup tables so if all you find is ROMs + standard logic that might be what they're doing

if that's the case i'm even more hosed than if I had to disassemble some antique 4004 code or something and find integers

i hate digital poo poo

gonadic io
Feb 16, 2011

>>=
hmm, this doesn't look good

code:
0000247c <__etext-0x68>:
    247c:	7ffffc38 	svcvc	0x00fffc38
    2480:	80978408 	addshi	r8, r7, r8, lsl #8
    2484:	7ffffca0 	svcvc	0x00fffca0
...
    24c4:	7ffffec0 	svcvc	0x00fffec0
    24c8:	8000b0b0 	strhhi	fp, [r0], -r0
    24cc:	7ffffec0 	svcvc	0x00fffec0
    24d0:	800ba8b0 			; <UNDEFINED> instruction: 0x800ba8b0
    24d4:	7ffffeec 	svcvc	0x00fffeec
    24d8:	8006abb0 			; <UNDEFINED> instruction: 0x8006abb0
    24dc:	7fffff14 	svcvc	0x00ffff14
    24e0:	00000001 	andeq	r0, r0, r1

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.
I told you, bro! I told you about microprocessors! I warned you, dawg!

Bloody
Mar 3, 2013

JawnV6 posted:

avoid The CUBE at all costs

vim/emacs would be better
actually the cube is good

gonadic io
Feb 16, 2011

>>=
dumb noob question

if i only have a 24V battery, and i use some DC/DC regulator to get it to 3.3

can i have


pre:
+24V ----- motor --|
       |           |
     DC/DC         |
       | (+3.3V)   |
     arduino       |
       |           |
 +0v --------------|

i.e. i don't need to protect the arduino from the ground rail, 0 is 0? the motor will have a rectifier diode to prevent kickback.

gonadic io
Feb 16, 2011

>>=
i mean i'll probably have to step up to 24 instead of stepping down to 3.3 but the question is still relevant

gonadic io
Feb 16, 2011

>>=
triple post project update:

i got digitial pio working in rust so my single-digit-button-counter
https://www.youtube.com/watch?v=S8MtqhWVQ2E&hd=1
is now implemented entirely in rust with a little bash script to compile and upload!

it's not especially good code, and i still can't get the address of __etext, but i'm pretty pleased that it's working

yippee cahier
Mar 28, 2005

gonadic io posted:

dumb noob question

if i only have a 24V battery, and i use some DC/DC regulator to get it to 3.3

can i have


pre:
+24V ----- motor --|
       |           |
     DC/DC         |
       | (+3.3V)   |
     arduino       |
       |           |
 +0v --------------|
i.e. i don't need to protect the arduino from the ground rail, 0 is 0? the motor will have a rectifier diode to prevent kickback.

0 is 0, yeah. some people might still warn you about noise from the motor, idk.

do you want to control the motor using the arduino? i used https://www.sparkfun.com/products/10213 to control a higher voltage DC motor from a 3.3V arduino.

gonadic io
Feb 16, 2011

>>=

yippee cahier posted:

0 is 0, yeah. some people might still warn you about noise from the motor, idk.

do you want to control the motor using the arduino? i used https://www.sparkfun.com/products/10213 to control a higher voltage DC motor from a 3.3V arduino.

yeah i have a bunch of those, currently i'm blinking an led with one but the plan is to control motors/solenoid valves with them

Bloody
Mar 3, 2013

Yeah zero is zero mostly although the motor may make your ground noisy n poo poo

hobbesmaster
Jan 28, 2008

ie "ground is ground unless it isn't and then you're hosed"

Bloody
Mar 3, 2013

nah like if you're working with highly sensitive analog stuff then you probably need to take caution with your grounds because they're not all zero and it matters n poo poo

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.
it's all fun and games until your inductive load starts ringin', flips that pulse around, and rams it backwards through your switching bank and capacitor

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

atomicthumbs posted:

it's all fun and games until your inductive load starts ringin', flips that pulse around, and rams it backwards through your switching bank and capacitor

got myself some rectifier diodes to put across the motors and solenoid valves

  • Locked thread