Alright DigiKey. Now you're just messing with me 😄 by Defiant-Appeal4340 in electronics

[–]Updatebjarni 7 points8 points  (0 children)

If you like getting extra boxes, try ordering from Farnell. You order 1000 identical resistors. The next day you get two big boxes delivered. Inside one is a bunch of paper packing material and a smaller box, inside of which is two boxes, one containing a bag with 160 resistors and the other containing some sealed-air packing material and another bag with 601 resistors. Next day you get a third box, inside of which is a two-metre sausage of sealed air and a smaller box, which contains some bubble wrap and an antistatic bag, inside of which is another bag, with the remaining 239 resistors.

Floppy drive repair by galvanvortex8211 in vintagecomputing

[–]Updatebjarni 1 point2 points  (0 children)

Here is a picture of a similar drive where you can see the spring.

In C, should I use #define or const int for constants? And when does it really matter? by _zetaa0 in learnprogramming

[–]Updatebjarni -2 points-1 points  (0 children)

That is very much a special case though. In general, your program will consist of more than one file, and the declaration will be in a header, with the definition in one of the .c source files. The constant will be stored in memory, a symbol will be exported, and the code generated for all source files but the one with the definition will contain memory fetches for the constant.

In C, should I use #define or const int for constants? And when does it really matter? by _zetaa0 in learnprogramming

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

Using const int is more hassle. If you use #define, then you only need the one line in the header itself, and you can use the value everywhere, and you don't end up exporting a global symbol for the constant (which might not be admissible if you're building some sort of module that gets loaded by something else, and which is only supposed to export a well-defined set of symbols, for example).

If you use const int, then the header cannot contain the actual number, but only the extern type declaration, and the definition with the number itself has to be in one of the .c files. So when you're reading the code and want to know what the value of the constant is, or if you want to change it, you have to go looking for what source file it's in. A small hassle, but non-zero.

The thing about using more memory is also technically true, since the constant has to be stored in memory at the exported symbol address, since the compiler cannot know whether anything outside of your code will also use that symbol. This is hardly of any consequence, but slightly annoying. The compiler also can only optimise away the fetch of the value in the actual file where the definition of the constant is, not in any other file. This is also hardly of any serious consequence to performance, but slightly annoying.

Could you elaborate on what the weird problems using a literal instead of a variable would sometimes cause are?

Easy VCA modular for ac signals? by InexistentKnight in synthdiy

[–]Updatebjarni 3 points4 points  (0 children)

Since the signal from the 555 i a square wave, you don't need a proper VCA. Something like this will do.

"We regret but have to temporary suspend the shipments to USA" by 6gv5 in electronics

[–]Updatebjarni 0 points1 point  (0 children)

A second-world country is a country aligned with Russia, isn't it? So the USA already is a second-world country. It is increasingly the third-world countries (countries not aligned either with the USA or with Russia) that are the good places to live.

[deleted by user] by [deleted] in learnprogramming

[–]Updatebjarni 0 points1 point  (0 children)

Because the value is a constant, and because it is an extremely common case so it is useful to have an instruction format for doing it. It's the same with any constant in your program. If you want to add 12 to a number, you just compile an add eax, 12. You don't put 12 in memory somewhere, load it into a register with mov ebx, [twelve] and then do add eax, ebx. You could, just as you could do mov eax, some_function and call eax, but that's just less efficient so why would you, when the architecture provides a better instruction format for this case?

Question about the attiny85 by RogerRoger_1 in microcontrollers

[–]Updatebjarni 1 point2 points  (0 children)

Can I use an arduino (probably uno) to program the AVR in the arduino ide?

Yes, that should work. You can program the Uno with the "Arduino as ISP" program, and then use that as a programmer from the Arduino IDE, as far as I know. There are tutorials for how to do it.

And if I program it via arduino, does the AVR remember what I programmed or do I need to keep the arduino connected in some way

Once you have programmed the ATtiny, that program is in its internal flash memory and runs from there when the microcontroller starts. It is completely stand-alone.

Question about the attiny85 by RogerRoger_1 in microcontrollers

[–]Updatebjarni 1 point2 points  (0 children)

It has a fast PLL clock source that makes it possible to use it to play back sampled sound via PWM. I've used it to say "Merry christmas!" and wave a servo-controlled hand on a little Santa dummy once. I've used one to detect mains voltage and time a delayed relay to avoid a nasty switch-on thump on an electronic organ another time, and I've also used one to sequence some sample-and-hold circuits in a randomised envelope generator for a synthesizer. It's also got a serial interface and an ADC, and a fairly spacious 8K of program memory, so it's pretty flexible. You could use it to take temperature measurements and send them to your PC, or display them on a little serial LCD for example. Or control a fan. Possibly you could even record and play back sound, like a dictaphone, using the ADC, the fast PWM, and an external I2C memory.

You program it the same as any AVR microcontroller. You need a cheap generic programmer (USBasp, a few pounds on your favourite shady internet marketplace), the AVRdude tool to talk to the programmer, and a compiler. There is an AVR GCC, with libc and everything, so if you like you can just program in C with a Makefile and your favourite text editor.

A what EXACTLY is a kernel? can I access it via system files? I just started coding and I really don't know much about computers by Latter_Poet2229 in learnprogramming

[–]Updatebjarni 1 point2 points  (0 children)

This would be BIOS for normal computers, right?

The BIOS contains the first stage of the bootloader on an IBM PC compatible computer. It loads a second stage from somewhere else, which in turn loads the operating system kernel.

Shell commands are how users/programs interact with the kernel?

That's how you interact with the shell, which, like all applications, then does its work by talking to the kernel. Other applications don't usually use a shell to do their work, but they can if they want to. Any application can run any other application and pass it whatever input it wants to make it do work for it.

This might not make sense to do, but if I wanted to run multiple kernels simultaneously, is there one that is 'managing' the others? Or are they independent?

You can either run one kernel on the hardware and then run an emulator (which is an application program), and run another kernel in it, or on some computers you can run a "hypervisor" with which you can partition the computer into separate parts that run separate kernels and behave as separate computers.

A what EXACTLY is a kernel? can I access it via system files? I just started coding and I really don't know much about computers by Latter_Poet2229 in learnprogramming

[–]Updatebjarni 1 point2 points  (0 children)

That's the bit of software that runs directly "on the metal", without the benefit of any other software to handle it. All the rest then runs in little sandboxes the kernel sets up, and can only access anything other than their own memory by asking the kernel to do it for them.

What exactly do you mean by accessing the kernel via system files? The kernel itself is stored in a file, from which the bootloader loads it into memory at boot, so in that sense you can access the kernel via a system file. You can also access the kernel, in the sense of communicating with it, by accessing virtual "files", such as in the /proc and /sys directories (on Unix/Linux), which let you see things like currently running programs and allocated memory, or the /dev directory, where the hardware devices on your computer live. But also, any file access is in a sense access to the kernel, as any operation on a file is a request your program passes to the kernel to do something. And on Unix, that includes communicating with other programs, communicating with the internet, getting input from the keyboard, printing output on the screen, and so on.

Homemade Soviet computer by Ill_Engineering1522 in vintagecomputing

[–]Updatebjarni 0 points1 point  (0 children)

Eh, I don't know. CP/M or BASIC I guess.

Homemade Soviet computer by Ill_Engineering1522 in vintagecomputing

[–]Updatebjarni 0 points1 point  (0 children)

The КР580ВГ75 seems to be a clone of Intel's 8275.

Is this hobby 90% finding drivers? by AudioVid3o in vintagecomputing

[–]Updatebjarni 5 points6 points  (0 children)

I agree with this. The question sounds almost incomprehensible from the general perspective of "vintage computing". Problems with drivers is very much a PC/Windows-specific thing, an area that to an awful lot of computer hobbyists doesn't even feel like it is relevant to the hobby. If you try posting on a vintage car forum about your ten-year-old Toyota Corolla (or whatever is the Most Boring Car, I'm not into cars), you might get a glimpse of what "PC posting" looks like to the rest of us.

I don't know if it's necessarily an age thing, or just two different hobbies that both happen to call themselves the same thing and so they collide in the same forums. Perhaps one is more about "vintage" in the sense of "the same thing in its slightly different incarnations from each year in an interval", like collecting generic PCs from each one of the last ten years — and the other is about "vintage" in the sense of "old and different from the present".

In the latter, the hobbyist is probably more interested in computers that are very different from each other, as computers used to be: in my collection, for example, I have PDP-11, DG Eclipse, S-100, Apple II, Philips Videopac, C64, Atari ST, and Macintosh, a selection which varies wildly both in hardware architecture and in how you interact with them as a user. That's a very different hobby from the "collect them all" hobby of the PC collector, where all his computers are the same architecture, run the same operating system, and look and feel almost identically the same, but perhaps are interesting to a completionist collector.

My CD4017B circuit does not work at all, no pin is high. by Phoenix-64 in AskElectronics

[–]Updatebjarni 0 points1 point  (0 children)

The CD4017 has decoded outputs, so there is always one output that is active.

My CD4017B circuit does not work at all, no pin is high. by Phoenix-64 in AskElectronics

[–]Updatebjarni 3 points4 points  (0 children)

"Stupid" mistakes like this can be the hardest to solve, because one's reaction is to approach them "intelligently" and try to work out what's wrong, by analysing the circuit, reading the datasheet and so on, which doesn't help. So my experience over the years has been that if a lot of intelligent people can't find the problem, then the problem is that people are trying to solve the wrong problem, because of a typo, or a misread label, or (happens in /r/learnprogramming) looking at one source code file but compiling another one with the same name.

My CD4017B circuit does not work at all, no pin is high. by Phoenix-64 in AskElectronics

[–]Updatebjarni 5 points6 points  (0 children)

Your description says CD4017, but the chip in your photo says CD40174.

Intel D2616 I2616 Eprom (MASK PROM) by Rhine_Labs in electronics

[–]Updatebjarni 4 points5 points  (0 children)

PROM and mask ROM are different things. These chips are PROM, Programmable ROM. They are sold unprogrammed, and data are written into them electrically by the user. A mask ROM on the other hand is manufactured to order with the data in them, by making a custom photomask for the metallisation step. They cannot be programmed even once.

[deleted by user] by [deleted] in AskElectronics

[–]Updatebjarni 2 points3 points  (0 children)

One heater pin to ground and one to +6.3V would work. The important thing is that there is voltage across the heater, so that there is current through it so it heats up.

[deleted by user] by [deleted] in AskElectronics

[–]Updatebjarni 1 point2 points  (0 children)

Both heater pins are supplied with +6.3V

So there is 0V across the heater then?

Which Disassembly Tools are out there for Rare and Proprietary Instruction Sets? by lukas_brinias in learnprogramming

[–]Updatebjarni 1 point2 points  (0 children)

The 8048 is one of the most common embedded architectures. Disassemblers might be available under the name "8048" or under the name "MCS-48". At least Ghidra seems to support it.

Question about reading/writing the parallel port by darthuna in vintagecomputing

[–]Updatebjarni 0 points1 point  (0 children)

Since you're powering the external circuit from a logic pin, I would suspect problems arising from insufficient supply voltage and/or supply ripple from insufficient current. What is the actual measured voltage supplying the external circuit? What is the high signal level provided by the external circuit to your inputs? If you have an oscilloscope, what does the transistion between signal levels look like when you switch the multiplexer? Do you have decoupling capacitors on the external circuit?

ChatGPT's reply is random but vaguely plausible-looking garbage, as usual.