[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself


View post   

File: 1.65 MB, 4320x3240, elec_all.jpg [View same] [iqdb] [saucenao] [google]
340770 No.340770 [Reply] [Original]

I'VE FINALLY DONE IT!
I dusted off my electronics stuff and my microprocessors will be here tomorrow or the next day. Helping people here with basic electronics has made me remember the magic that electronics used to have for me. The arduino threads helped too, though I've decided on a different route. I ordered 2 MSP430G launchpads for $8.60 with free Fed-x shipping. How can they even do that?

Anyway, THANK YOU /diy/, I've been waiting for this inspiration for 10 years.

>> No.340771
File: 1.45 MB, 4320x3240, elec_isa.jpg [View same] [iqdb] [saucenao] [google]
340771

The last complicated thing I did was inter-phasing to an ISA bus on a 286. ISA was the standard computer slot before PCI.

>> No.340772
File: 1.62 MB, 4320x3240, elec_dunno.jpg [View same] [iqdb] [saucenao] [google]
340772

I remember the bottom board cause I made a circuit board for it. The top one, I have no Idea, but it looks interesting.

>> No.340789

I'm an electronics newfag, currently watching mjlorton's tutorials on youtube, am I right guessing that quite soon my research will have to branch off into either digital or analogue circuits? I would love to do both but I'm guessing its FUKKEN complicated further on.

>> No.340833

Im also intrested in electronics, but i dont know what equipment and components too buy

>> No.340870

>>340789
Digital is pretty easy to start in. Its more logic than anything. CMOS 4000 series is what I started with, it's pretty forgiving. start with simple gates, then latches
Analog is pretty math intensive and you need to be good with algebra to go very far.

>>340833
you can get started with a $10 cheap meter, some resisters around 1k to 100k, a dc power supply like a phone charger and some jumpers with alligator clips.
A cheap meter is better for starting out because it's cheap to replace. Start with ohms law and understanding the relationship between voltage current and resistance. Then move on to series and parallel circuits.

>> No.340999

>>340771
>ISA bus on a 286
Jeezus, I thought I was the old guy on this board at 31.

Good work OP, electrical tinkering is a rewarding hobby (I like how uninitiated people often seem to think it's some sort of "magic").

>> No.341528

bumping this thread for potentional more interested people

>> No.341558
File: 58 KB, 314x409, Sylvania-TV-tube-ad-1946.jpg [View same] [iqdb] [saucenao] [google]
341558

>>341528

no need to bump, its a slow board, thread will be here for days or a week or more.

>> No.341595

>>341558
I was bumping because the thread was lurking on page 4'ish, and the more its on the front page, the more people will see it

>> No.341652

>>340770
i did the same but not because of 4chan but due to my masters programme. ordered hundreds of components from tayda (look them up, they are dirt cheap) shit is going to be cash ehm electronic

>> No.341851
File: 49 KB, 565x486, msp430diagram.gif [View same] [iqdb] [saucenao] [google]
341851

They came in today!
I got a basic light blinking program working and have played around with it a little. I did it first using a GUI called grace (I just followed a video), using the timer and interrupts, but that's a little advanced for me now and I didn't fully understand the code it generated. I re-did it using simple code I understood, using a time consuming loop.

I need to refresh my memory in hexadecimal. I'm not used to doing logic operations on 8 bits and it's a little confusing.

Here's the code to blink 2 LED's back and forth. I changed it from a program to blink 1 LED

#include <msp430g2553.h>
unsigned int i = 0;

void main(void){
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= 0x41; // Set 2 pins for output
P1OUT |= 0x01;//OR with 0000 0001-red LED on
P1OUT &= ~0x40; //AND with 1011 1111 -green off

for (;;) {
P1OUT ^= 0x41; //Togle bits using XOR
for(i=0; i< 40000; i++);
}

}

I think I'm gonna love this. This chip has so much neat stuff, I'm not sure what to do next. I guess I'll keep it simple for a while to get more familiar with CSS, Hex and C.

>> No.341860

>>341851
Congratulations on getting into mcu programming. You van express values in binary like 0b10000001. I've always found that easier to follow at times like setting a specific pin of an output port.

You're also going to want to modify your clock control registers at some point for faster speeds.

You don't need to always work with 8bit values. You can declare 32/16bit variables and CSS will convert to a set of 8-bit operations that handle the logic properly.

>> No.341888

>>341860
are you saying
P1OUT ^= 0x41;

can be changed to:
P1OUT ^= 0b01000001;
? . It sure would make it a lot easier to visualize.

I tried that and got a build error. (extra text after expected end of number) CSS4

I've looked it up and from what I gather, It doesn't work without adding code for it.

>> No.342135

>>341851
yuck code, i dislike programming and developed a fetish for 4000 and 74hc. but sadly there comes a point where i can't save myself with some simple gates and i will have to learn how to use arduinos or something.

>> No.342199
File: 350 KB, 2048x1536, elec_first.jpg [View same] [iqdb] [saucenao] [google]
342199

I managed to get the outer LEDs on a 7-segment display to go in a circle last night. Babbys first CSS program.

>>342135
>4000 and 74hc
Me too. my second CMOS cookbook is held together with rubber bands.

I used to do a lot of BASIC programming. I followed a "learn C++ in 45 days" or something years ago, but I didn't care much for it and haven't programmed since. Once I kinda learned my way around this program (CSS), The experience is more like breadboarding than any programming I've ever done. I think I could duplicate just about any low power circuit I've ever built with this chip. Now, I'll be able to save code snippets instead of always needing 1 more breadboard because I don't want to disassemble a circuit.

>> No.342204

>>341888
>0b01000001;

huh, are you using msp430gcc? that should work. Maybe you need to modify your cflags?

you could also just use google as follows:
https://www.google.com/search?q=0b01000001+to+hex

or

https://www.google.com/search?q=0x41+to+binary

>> No.342218

>>342204
msp430G2553
I can do em in my head, but it would be easier to just put in the binary.
From what I read somewhere, you can create a header file to handle them when it's compiled.
>modify your cflags
Maybe in the future. That's a little beyond me right now. C newfag.

>>342135
The arduino uno runs about $50. The msp430g launchpad is $4.30. Also, once it's programmed, I can just unplug the chip and put it in a breadboard. I think you can even use energia (arduino tool) if It's set up correctly.

Here's a comparison I found:
The MSP430 2553, which is the processor that ships with the Launchpad, has 14 I/O pins and 16K of program memory. Compare this to 20 I/O pins and 32K of program memory of the Atmel 328, the chip in the Arduino Uno, Nano, and several others.

>> No.342227
File: 871 KB, 3264x2448, componants.jpg [View same] [iqdb] [saucenao] [google]
342227

>>342218
>arduino uno runs about $50
I was thinking of the arduino MEGA. I think the uno is about $30-$35

>> No.342260

>>342218
you can get them pretty cheap on dealextreme and ebay if you look carefully (some are fucked) if you buy them "official" you pay quite some money for the dev team to make new things

>> No.342274

>>342227

Don't bother even getting a full arduino if you plan on breadboarding it anyway and you want to use the arduino IDE.

Pre-bootloaded ATMEGA328
http://www.dipmicro.com/store/CPU-ARD328P

USB to TTI cable, works straight from your computer to program the chip assuming you build a basic breadboard layout for the chip.
http://www.dipmicro.com/store/BTE-PL2303HX-MOD

I bought a ton of those chips, flashing the boatloader is a pain so preloaded is sweet, and using arduino scripts on it for $3 a pop (and a crystal and a microswitch) is nice.

>> No.342288

This is the coolest thing for only $4.30. I just purchased one and have nearly no electronic experience. Time to start a new hobby, thanks /diy/.

>> No.342315

>>340770
shiet!
pic is hawt!

>> No.342362

I've been wanting to make a circuit with 2 USB ports, one for a webcam and one for a flash drive. The hope is to record directly to the flash drive from the webcam, and begin looping when the disk is full. What would be the best way to go about it?

>> No.343364

I loaded an 8 bit shift register today! (4015)
Using only 2 processor pins, I displayed an 8 bit binary counter on some 7-segment displays. Could go to 16 bit with only minor changes.
I also discovered that you can step through the code, line at a time, and watch variable values. Awesome.

Here's the code I worked all day on. It doesn't look like much, but it was quite an accomplishment for me cause but I'm really rusty with C.

void byteout(unsigned char byte){
unsigned int bit=1;
for(bit=0;bit<8;bit++){
if (byte>>bit & 0x01){
P1OUT |= 0x01;//p1.0=1 -OR 0000 0001
}
else {
P1OUT &= 0xFE;//p1.0=0 -AND 1111 1110
}
P1OUT |= 0x10; //p1.4 = 1 //clock for 4051
P1OUT &= 0xEF; //p1.4 = 0 //clock for 4051
}
}

>> No.343915

bump

>> No.344456
File: 147 KB, 1632x1224, msp430 clock ref sample.jpg [View same] [iqdb] [saucenao] [google]
344456

I haven't hooked up anything interesting.
I've been learning the clock and how to program it, It's kinda confusing.

To select the DCO(digitally controlled oscillator).
1)look in users guide to find the related registers
2)search header file to find the mnemonic.
3)look at schematic to see what it actually does.

I could just copy-paste code, but I'd rather have a full understanding of what's actually happening.

Today I'm going to try to make myself a reference guide in inkscape to put all the info in one place, based on the schematic.

Seems like it would be easier to just do it in assembly, but I guess when I'm more familiar with it, the mnemonic will be easier to remember and save looking stuff up.
Right now, it just seems like unnecessary steps.

I'm bewildered by the stuff available since I last breadboarded. I couldn't have bought 1K of memory for what this chip costs.

>> No.345002
File: 1.24 MB, 2063x3323, MSP430 Clock Module_v3.png [View same] [iqdb] [saucenao] [google]
345002

>>344456
The red in that pic is wrong.

I think I get header files now.
I made this reference for the clock module that shows the schematic, control registers, memory location, and associated header file entries. Hopefully it will come in handy.

Time to move on to inputs.
YEEEAAAA!!!

>> No.345021

I see a lot of microchip buffs in here- I'm curious if you guys might help with a curiosity I have.

I'm looking to make a motor controller using either programable (digital), or non-programable (analog setup). I'd like it to control a 3-phase A/C motor. The power supply could be a battery or a wall-outlet.

Where would you guys start? Does anyone have a good source that you would use to find a wiring diagram or parts list? I've been googling for ages and it has been a very long pursuit, but I haven't yielded any results.. help please

>> No.345056

>>342362
there's probably some asic that does pretty close to what you're after already. Otherwise, start by making a UART module on whatever MCU etc you want.

>>345021
regardless of single or 3 phase source from wall outlet- rectify with full diode bridge and add smoothing caps/ decoupling caps to get a rough DC supply.

next 2 possible ways to drive the motor: add hall sensors or encoder to motor, and commutate it as a BLDC motor

or drive the motor with a conventional 3 phase sine wave, as it normally would be (open loop)

I'd go for the 1st option (especially if using a battery) since there will be no issue with rotor slip. If you are using a battery and motor is wired for 240/440v you'll need to make a charge pump as well. You'll also need to make a 3 phase full bridge drive (mosfets or IGBT's)

you can then drive the fets via gate drives with a square wave output from the MCU you use, based on the combination of hall sensor inputs into the MCU (6 step commutation for BLDC). The high side of the mosfet bridge is driven by PWM- change duty cycle to vary motor speed.

Or, if you want to drive it conventionally, you will have to vary the PWM duty cycle applied to high side transistors, so the current wrt time produces a sine wave. Each sine wave is 1/3 of a period out of phase wrt the preceding wave. Change the period of the wave (i.e. change frequency) to change motor speed.

>> No.345057

>>345056
>with a square wave output from the MCU
well rather the the current the bridge sinks will be a square wave- the MCU output is a constant duty PWM

>> No.345087

>>345056
Trying to roughly understand this, my basic parts consist of:
Diode bridge with the addition of "smoothing caps/decouplers"
Hall Sensors
3 Phase Coil Setup
(not sure what a charge pump is)
Mosfet or IGBT Chip (I'm assuming this is the brain)
Gate Drive (where does this go/what is it?)
MCU (is this the mosfet from earlier?)

I appreciate the time you took to lay this out in text, I will definitely save your post under my project folder to study as I continue with trying to wrap my head around this.

Also, is there a place that you might get a wiring diagram for an example of something similar (to see everything laid out)?

>> No.345138

Using 0b00 notation might work on a few compilers but not all. If you use it your code will not be portable.
If you know the specific bit you are setting you can use shift operators.

1 is 0000 0001
1 << 0 is same as 1
1 << 1 is 0000 0010 (decimal 2)
1 << 3 is 0000 1000 (decimal 8)
8 >> 1 is 0000 0100 (decimal 4)

Important note: pin 7-> 0000 0000 <- pin 0
PORTB |= (1 << 3); // Set pin 3 (0000 1000).
PORTC |= (1 << 2) | (1 << 4); // Set pin 2 and 4 (0001 0010).

You can also name your pins making it easy to understand what you were trying to do even without comments.
#define RED_LED (1 << 3)
const unsigned char GREEN_LED = (1 << 5);
PORTD &= ~GREEN_LED;
if (begin & RED_LED) PORTD |= RED_LED;
if (done) PORTD ^= (RED_LED | GREEN_LED);

>> No.346203

>>345138
>You can also name your pins making it easy to understand what you were trying to do even without comments.
That's starting to make sense to me now. I think I need to start doing that. It would also make it easier to modify your code for a different circuit.

I used the ADC last night to read a voltage. I had a variable set to the voltage my meter showed within 0.01 volts. I didn't hook up anything to display it, I was just using the "watch" on CCS. I also dug out a linear drive (a motor moves a carriage back & forth similar to a lathe) I made years ago that I was controlling with BASIC. The circuit with an 8 bit ADC took up an entire breadboard and I'm not sure if it even had the stuff to communicate with the LPT: port. This has 4X the resolution and takes up no breadboard space and that's just one channel!. The more I learn about this chip, the more I'm bewildered at it's capabilities. I might take some pics with my phone later of my old circuit (my camera is being replaced and I'm waiting on the mail).

Is there any way to watch variable values on the computer without manually having to pause/resume the MSP430 program?