hybridfree/eevblog-posts huggingface dataset:
Struggling to run lbry API daemon in Docker - Page 1
Forum section: electronics / general

author: CyberJacob
author_rank: Newbie
timestamp: June 25, 2021, 07:39:35 pm
content: Hi Folks,Given Dave's recent fondness of lbry (and other non-YouTube platforms) I decided to try adding support for it to a program I maintain, which replaces YouTube's rather useless recommendations and subscription system with one that actually works (i.e. shows you videos from channels you subscribe that you haven't watched yet). For reference it'shttps://github.com/cyberjacob/ytsm/, but that's not really related.Anyway, I’m trying to set up the lbry API daemon for some development, as suggested by the documentation athttps://lbry.tech/api/sdk. To start with, the majority of docker images published by lbry are missing any kind of documentation (for example lbry/lbrynet-tv, the most downloaded image). I then found the lbry/wallet-server image, the description for which shows it’s the lbry SDK, however running this only results in aconnection problem - is your daemon runningerror, suggesting it’s documentation is wrong and it’s not the SDK daemon.After a large amount of trial and error, I found the lbry/lbrynet image. This is lacking much useful documentation for running the image, but the sample command confirms it’s for the daemon. Running this results in a large number ofon-demand fetching height logmessages, however the image then exits.As a new developer to the lbry platform, this all contributes to a feeling that lbry is not yet mature enough for any reasonable amount of work, and that a huge amount of time would be wasted attempting to get even the very basics up and running. Am I missing something obvious here? I realise my likelihood of someone here knowing how to fix this is slim to none (no offence intended), but maybe someone (Dave?) could persuade them to write actual documentation?
printing decimal part of a number having the bits - Page 1
Forum section: electronics / general

author: Moriambar
author_rank: Unknown
timestamp: June 10, 2021, 02:41:52 pm
content: Hi.My problem is quite complex, perhaps due to my lack of skill and knowledge.I have an attiny84 which receives a 16bit "number" which represents the mantissa (idk whether it's correct in English) of a number.By representing I mean that bit 15 indicates the "1/2" fraction, 14 the "1/4" fraction and so on.If this can simplify matters: I don't ever have to consider the full 16 bits, there's no harm in doing that (those that I don't have to consider will be 0), but I have the number of "significant bits".So now my goal is to print the decimal value of that thing (print as on an i2c lcd). For example if my bits are E1 10 00 00 this should correspond to "908203125" (1/2+1/4+1/8+1/32+1/256 if I calculated correctly).Currently I devised a method to calculate the number, except for leading zeroes, ie if I have 1/128 (=0078125) I can easily get the "78125" but it's hard to determine the number of leading zeroes.I think then perhaps there's either a very good way to calculate the mantissa or some "general" way to calculate my leading zeroes, giving the number of bits (without hardcoding them).Can anyone please help? I'll try and give as much info as I can.Cheers

author: oPossum
author_rank: Super Contributor
timestamp: June 10, 2021, 03:18:07 pm
content: Code:uint32_t x = 0xE110;printf("0.");do printf("%c", ((x *= 10) >> 16) + '0'); while (x &= 0xFFFF);

author: Moriambar
author_rank: Unknown
timestamp: June 10, 2021, 04:13:55 pm
content: Quote from: oPossum on June 10, 2021, 03:18:07 pmCool I adapted this to my specifics and it works like a charm. It also made me find some bugs in my reasonings. Thanks!!
What is a good tsop 48 programmer? or universal? - Page 1
Forum section: electronics / general

author: psxpetey1
author_rank: Regular Contributor
timestamp: October 28, 2020, 01:51:43 pm
content: I've found the cheap boys on alibaba but they don't seem to do the MT29F128G08CFABBWP What are some good true universal programmers?

author: Cocodo
author_rank: Newbie
timestamp: February 26, 2021, 01:47:55 pm
content: Take a look at RT809H.I have it and it does the job.

author: Qw3rtzuiop
author_rank: Frequent Contributor
timestamp: February 26, 2021, 02:59:14 pm
content: The xgecu T56 claims also to be able to do that.http://www.xgecu.com/MiniPro/T56_List.txtIm happy although it isnt as nice as the batronix programmers.

author: srobik
author_rank: Newbie
timestamp: April 23, 2021, 04:34:55 pm
content: HI,Hello, I have a problem. I need to load and program: High-Density EE CMOS Programmable LogicMACH110 MACH 1/2 Data Sheets The MACH110 is a member of our high-performance EE CMOS MACH 1 family. This device has approxi- mately three times the Logic macrocell capability of the popular PAL22V10 without loss of speed. The MACH110 consists of two PAL blocks intercon- nected by a programmable Switch matrix. The two PAL blocks are essentially PAL22V16 structures complete with product-term arrays and programmable macro- cells. The Switch matrix connects the PAL blocks to each other and to all input pins, providing a high degree of connectivity between the fully-connected PAL blocks. This allows designs to be placed and routed efficiently. n Pin-compatible with MACH111 MACH210 MACH211 MACH215 By Lattice Semiconductor Corp.Can you help me?

author: coromonadalix
author_rank: Super Contributor
timestamp: May 21, 2021, 06:13:38 am
content: Some Elnec programmers can do MT29F128G08CFABBWP tooThe MACH series tooI have an Beeprog+ and they are supported, but the adapter can be costly ?
Trouble adding existing files to project in Atmel Studio 5.1 - FIXED - Page 1
Forum section: electronics / general

author: basinstreetdesign
author_rank: Frequent Contributor
timestamp: April 30, 2021, 03:47:52 am
content: I have 4 C files that make a project for the ATMEGA16 and am using Studio5.1 to compile them but it will compile only 1 file and ignores the rest. Can anybody suggest what I can do to add the other 3 files to the program so that they are compiled and linked?

author: MIS42N
author_rank: Frequent Contributor
timestamp: April 30, 2021, 07:03:44 am
content: Is that version 10 years old or more? Maybe a later version will work for you.https://www.avrfreaks.net/forum/if-you-have-problem-5661-upgrade-62?name=PNphpBB2&file=viewtopic&t=124239

author: basinstreetdesign
author_rank: Frequent Contributor
timestamp: April 30, 2021, 01:34:28 pm
content: I just finished a project using this compiler and it had 5 source files. No problem compiling the lot and producing the *elf file to download to the target. But now with a new project it can see only one file, the one with main{} in it. I used the >FILE>NEW>FILE menu command to create files as I thought I had before, and it will do so but the compiler ignores them. Its running on a Win XP machine I have just for programs like this.

author: Psi
author_rank: Super Contributor
timestamp: April 30, 2021, 01:39:56 pm
content: Have you added all the extra files to the project?The IDE needs to know to add them to the makefile.

author: Syntax Error
author_rank: Frequent Contributor
timestamp: April 30, 2021, 01:47:13 pm
content: Nothing wrong with XPI suspect you may need to first convert the other files into shared libraries(?) A bit about this:https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.htmlAnd on importing precompiled libraries into AShttps://www.avrfreaks.net/forum/how-import-libraries-my-project-atmel-studio-7To help, make sure the files are in the same directory as main.

author: basinstreetdesign
author_rank: Frequent Contributor
timestamp: May 01, 2021, 05:56:33 pm
content: Quote from: Psi on April 30, 2021, 01:39:56 pmThat's the problem - there seems to be no faculty to add files to the project.Anyway - Fixed. I patched the *cproj file to list all 4 source files. After another small fixup to one of the source files it compiled and linked them all to produce the *.elf file which I download to the target. It seems to run since the processor is producing some signals that indicate its working.
Atollic TrueStudio OR Segger Embedded Studio? - Page 1
Forum section: electronics / general

author: sb37_dude
author_rank: Newbie
timestamp: March 29, 2021, 06:39:52 pm
content: Want to start another embedded project and I'm noticing a difference in these IDEs. Was wondering what people use in our community.

author: dgtl
author_rank: Regular Contributor
timestamp: March 29, 2021, 06:46:57 pm
content: Atollic got bought by ST, the TrueStudio is no more. It's now STM32CubeIDE. Only for STM32, free.
microprocessor code - Page 1
Forum section: electronics / general

author: harrysmith
author_rank: Contributor
timestamp: April 23, 2021, 02:58:56 am
content: Hi everyone. what is the best books to better understand the architecture of the intel 8086 microprocessor. is there a website for more information about 8086 ?thanks

author: brucehoult
author_rank: Super Contributor
timestamp: April 23, 2021, 05:37:33 am
content: https://www.amazon.com/Lance-Leventhals-80386-Programming-Guide/dp/055334529X??I don't know this book specifically, but the author's books on 6502 and z80 were great.

author: PKTKS
author_rank: Super Contributor
timestamp: April 23, 2021, 10:07:56 am
content: Well... in my specific case...*IF* someone ask about 8086 *OR* 80286 (386/486 etc...)..I would tell them that it is thevery hard waytryingto understand 8086 without understanding 8085 andHOWthe 8085 was "influenced" by the superiorfeatures of Z80 (like for example index registers etc)which ultimately lead to the 8086 as it is.Being a considerable upgrade when the protect moderegister table was introduced...Tracking 8080 to 8085 and how 8085 result in 8086 via Z80is probably the best way to understand very critical internal stuff...from 286 ahead the path is different..Paul

author: David Hess
author_rank: Super Contributor
timestamp: April 23, 2021, 10:30:58 am
content: https://www.amazon.com/8086-Book-Russell-Rector/dp/007931029X/

author: westfw
author_rank: Super Contributor
timestamp: April 23, 2021, 11:13:57 am
content: Did you actually mean 8086, or are you looking for info on modern “x86” cpus?

author: harrysmith
author_rank: Contributor
timestamp: April 23, 2021, 12:43:07 pm
content: I meant the 8086 microprocessor

author: rstofer
author_rank: Super Contributor
timestamp: April 23, 2021, 10:40:41 pm
content: I just tried to Google for '8086 architecture'Here's one reply:https://www.tutorialspoint.com/microprocessor/microprocessor_8086_overview.htm

author: MIS42N
author_rank: Frequent Contributor
timestamp: April 24, 2021, 10:36:02 am
content: It depends on how familiar you are with microprocessors in general. If you already understand stacks, registers, ports, interrupts, etc and just looking for 8086 specific stuff, you might get enough from the original workshop notebooks, you can download fromhttps://archive.org/details/bitsavers_intel. Just search the page for 8086, there's two workshops and a (rather large) user's manual you can download.
NEON Nonsense (ZYNQ-7000)? - Page 1
Forum section: electronics / general

author: AkiTaiyo
author_rank: Contributor
timestamp: March 29, 2021, 02:41:06 pm
content: Hi.Hopefully someone on here can enlighten me as to why something seems to be stripping my instrinsics.My initial had the same problem so I’m just trying something simple now, load up two vectors rotate all the elements right with a narrow to 16-bit words, pack it to a 16x8, then save it :Code:int32x4V1 = vld1q_s32(src);int32x4V2 = vld1q_s32(src+4);int16x4V1 = vshrn_n_s32(int32x4V1, 1);int16x4V2 = vshrn_n_s32(int32x4V2, 1);int16x8_t cmb = vcombine_s16(int16x4V1,int16x4V2);vst1q_s16(dst, cmb);src+=8;dst+=8;If I look in the assembly output from GCC it looks good:Code:308 02ee 61F98D0Avld1.32{d16-d17}, !309 02f2 61F98F2Avld1.32{d18-d19}, 310 02f6 DFEF3008vshrn.i32d16, q8, #1311 02fa DFEF3228vshrn.i32d18, q9, #1312 02fe 62EFB211vmovd17, d18 @ v4hi313 0302 42F94D0Avst1.16{d16-d17}, !But the disassembly from Eclipse shows something completely different (only shown part because its huge):Code:272int32x4V2 = vld1q_s32(src+4);00012258: ldr r3, [r11, #-8]0001225c: ldr r2, 00012260: movw r3, #5327600012264: movt r3, #12900012268: ldr r3, 0001226c: asr r3, r2, r300012270: sxth r2, r300012274: ldr r3, [r11, #-12]00012278: strh r2, 273int16x4V1 = vshrn_n_s32(int32x4V1, 1);0001227c: ldr r3, [r11, #-8]00012280: add r3, r3, #400012284: str r3, [r11, #-8]274int16x4V2 = vshrn_n_s32(int32x4V2, 1);00012288: ldr r3, [r11, #-12]0001228c: add r3, r3, #200012290: str r3, [r11, #-12]275int16x8_t cmb = vcombine_s16(int16x4V1,int16x4V2);00012294: ldr r3, [r11, #-40]00012298: add r2, r3, #20001229c: str r2, [r11, #-40]000122a0: ldrh r3, 000122a4: mov r2, r3000122a8: ldr r3, [r11, #-8]000122ac: ldr r3, 000122b0: add r2, r2, r3000122b4: ldr r3, [r11, #-8]000122b8: str r2, So it almost looks like its stripping the SIMD instructions out and replacing them with linear versions.What’s happening here? Does Eclipse disassembler just interpret the instructions wrong or are the SIMD instruction being replaced at some point? Are my compiler options incorrect?CPU: Zynq7000 – running PetaLinuxGCC: arm-none-linux-gnueabihf 10.2GCC options (tried many different combinations): -O2 -mfpu=neon -fcommon -march=armv7-a+simd+neon+vfpv3-fp16+neon-fp16+mp "-Wa,-ahl=$*.s"

author: AkiTaiyo
author_rank: Contributor
timestamp: March 29, 2021, 03:39:39 pm
content: Never mind... Turns out the GDB wasn't replacing the file on the target...
pclose() waits for the associated process to terminate - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: March 19, 2021, 03:54:09 pm
content: Code:gnuplotPipe = popen("/usr/bin/gnuplot -persist", "w");if (gnuplotPipe){fprintf(gnuplotPipe, "plot \"%s\" with lines\n", DataFileName);fflush(gnuplotPipe);DataFile = fopen(DataFileName, "w");for (i = 0; i < dataSize; i++){x = data.x;y = data.y;fprintf(DataFile, "%lf %lf\n", x, y);}fclose(DataFile);fflush(gnuplotPipe);pclose(gnuplotPipe);remove(DataFileName);}I am writing a piece of code that tries to open a pipe with gnuplot for plotting data.According to the documentation, pclose() should wait for the associated process to terminate and returns the exit status of the command as returned by wait4().However, there is something wrong since the program terminates with still gnuplot opened in a window.Doesn't pclose() wait for the gnuplot process to terminate? Where am I wrong?

author: ejeffrey
author_rank: Super Contributor
timestamp: March 19, 2021, 04:15:34 pm
content: http://www.bersch.net/gnuplot-doc/persist.htmlWill answer the question.

author: DiTBho
author_rank: Super Contributor
timestamp: March 19, 2021, 04:40:00 pm
content: QuoteSo this is the problem. I assumed it pclose was able to force it to exit: my mistake

author: DiTBho
author_rank: Super Contributor
timestamp: March 19, 2021, 04:50:14 pm
content: Without "persistent" the program exits without anything plottedProbably the GNUPlot x window is immediately terminated.

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 19, 2021, 05:53:21 pm
content: You'll probably want to addbind all "alt-End" "exit gnuplot"pause mouse closeafter theplotcommand, and not use the persist option, so that the window exists (and pclose() blocks) until the user closes the window (by using the window close button, Ctrl-Q, or Alt+F4).

author: DiTBho
author_rank: Super Contributor
timestamp: March 19, 2021, 06:46:32 pm
content: Perfect! This does the job, thank you!
Mini pro 866TL - Page 1
Forum section: electronics / general

author: Hornnumb2
author_rank: Regular Contributor
timestamp: February 25, 2021, 01:46:06 am
content: New to this I need to change the vin in a GM junk yard radio, once I download the eeprom file can I directly edit it in the software or do I need to export it to something else? Thanks Michael

author: oliviasmithh900
author_rank: Contributor
timestamp: March 08, 2021, 12:51:09 am
content: You need to share more details, how can anyone help you out here

author: kimlanbu
author_rank: Newbie
timestamp: March 16, 2021, 01:25:45 pm
content: From XGPRO V10.71 software you can not change on the fly. First you have to export as hex and edit outside. Then Load again from XGPRO
Post-Brexit software licensing - Page 1
Forum section: electronics / general

author: SilverSolder
author_rank: Super Contributor
timestamp: March 14, 2021, 03:37:50 pm
content: I just noted this gem in an Embarcadero product:"Note: A Named User (Workstation) License is ONLY valid in the country of purchase or country as specified on the "ordering documentation" (except within the European Union (EU) where, by law, any license purchased within the EU can be moved within any country within the EU). If you ship it to another country the license is no longer valid and will have to be repurchased for the required country."Brexit wrecks it again. How many other products does this apply to?

author: Bicurico
author_rank: Super Contributor
timestamp: March 14, 2021, 06:24:15 pm
content: It certainly applies to all Autodesk products.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 14, 2021, 06:51:37 pm
content: Uh. Does that mean that existing customers in the UK that bought their license before the Brexit have to all renew their license now? I somehow have a hard time believing software vendors can pull that off.

author: Monkeh
author_rank: Super Contributor
timestamp: March 14, 2021, 07:15:48 pm
content: Quote from: SiliconWizard on March 14, 2021, 06:51:37 pmNo, but it means you technically need to have another license if you work in the EU as well!I won't blame Brexit for this one, though, this is just software vendors being scum.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 14, 2021, 07:22:37 pm
content: Quote from: Monkeh on March 14, 2021, 07:15:48 pmWell, it's not that much of a problem then. Especially since those licenses are named licenses and most users are probably professional users. So that would possibly affect you if you work in different countries as an individual. Yeah. Big deal. Frankly if your company has several offices in different countries, with employees regularly changing countries themselves, the cost of software licenses is probably not the main concern. Looks like noise about not much.

author: bd139
author_rank: Super Contributor
timestamp: March 14, 2021, 07:23:01 pm
content: Ignore it. No one gives a fuck. Apart from Oracle. Who will be around on Tuesday to collect your organs.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 14, 2021, 07:26:39 pm
content: Quote from: bd139 on March 14, 2021, 07:23:01 pm

author: rstofer
author_rank: Super Contributor
timestamp: March 14, 2021, 07:48:28 pm
content: So you can’t take your laptop to a foreign job site?Find another vendor!

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: March 14, 2021, 08:06:34 pm
content: At least one license goes on to state "Temporary usage of a Product outside the Licensed Country or Territory not to exceed thirty (30) days while a user is traveling, is permitted."If you are spending time working/living between the UK and EU, I think this is a minor trifle compared to the Brexit fallout to come.
PICkitPlus - new Turbo mode - Page 1
Forum section: electronics / general

author: Anobium
author_rank: Regular Contributor
timestamp: March 08, 2021, 10:38:38 am
content: Even more great news from the PICKitPlus team. I thought I would make your aware of this upgrade as soon as possible.We now have improved the performance of the PICKitPlus Software. We have upgraded the software, and the parts database, to decrease the programming/verification time. We have reduced some programming operations from 40 seconds to 3 seconds! Programming is fast for specific use cases. An amazing improvement. We call this Turbo Mode.We also recently updated software that made it possible to support the PIC18FxxQ10, PIC18FxxQ40, PIC18FxxQ41, 16F152xx and add corrections for the 1F16184x microcontrollers.Over this weekend we provided this new software to all the existing users. So, if you are an existing user please look out for the email.We have recently released PICKitPlus for the Linux and Raspberry Pi. You can try PICKitPlus for the Linux or Raspberry Pi! Just contact us. We can provide a trial license. Try it before you buy it.Next… PICKitPlus software for Mac OS and our own unique programmer solution.Please support this project and get the software via our websitewww.pickitplus.co.ukEvan

author: EEVblog
author_rank: Unknown
timestamp: March 08, 2021, 11:36:14 pm
content: Please change your signature to include that you are a dealer, it's not clear from your username.
Range checking... - Page 1
Forum section: electronics / general

author: westfw
author_rank: Super Contributor
timestamp: March 05, 2021, 12:56:00 am
content: Has there ever been an Instruction set Architecture that includes an explicit "range check" instruction?I'm thinking something that would cause an exception, rather than storing a result.Code:rangecheck op1, op2, op3 ; raise an exception if op1 is not between op2 and op3.rangecheck op1, op2 ; raise an exception if op1 is not between zero and op2.Ideally, op2, op3 could be immediate values, or whatever the CPU normally uses for operands (registers on RISC, anything on CISC?)

author: retiredfeline
author_rank: Frequent Contributor
timestamp: March 05, 2021, 01:09:06 am
content: Here's one hit for a quick search:https://en.wikipedia.org/wiki/Bounds_checking

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 05, 2021, 01:13:47 am
content: In particular, you can take a look at Intel MPX:https://en.wikipedia.org/wiki/Intel_MPX

author: MK14
author_rank: Super Contributor
timestamp: March 05, 2021, 02:34:09 am
content: Yes, the X86 has such an instruction, available for a long time. Which creates an exception, if the bounds are exceeded.https://www.felixcloutier.com/x86/boundHere it is, for the 386 cpu (Intel):https://pdos.csail.mit.edu/6.828/2018/readings/i386/BOUND.htm

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 06, 2021, 06:00:08 pm
content: Quote from: MK14 on March 05, 2021, 02:34:09 amNote that the 'bound' instruction is not available in 64-bit mode AFAIK, so in this case, I guess the Intel MPX extension is the alternative for Intel CPUs. (It's more capable than just the original bound instruction too...) It was also known to be actually slower than using several instructions for bound checking starting with the i486...I'm not aware of similar instructions in ARM and MIPS ISAs, but I'm not a specialist of those either, so if anyone knows?

author: DiTBho
author_rank: Super Contributor
timestamp: March 06, 2021, 08:19:52 pm
content: Quote from: westfw on March 05, 2021, 12:56:00 amProgrammers can use the CHK2 instruction in the Motorola 68000 to check if a number is within a certain range.Why do you ask it?
The Pico RP2040 Mandlebrot challenge! - Page 1
Forum section: electronics / general

author: techman-001
author_rank: Frequent Contributor
timestamp: February 26, 2021, 10:29:13 am
content: Can you beat Matthias's Mandlebrot binary of 252 Bytes ?See this URL for the details and complete project including the Assembly source.https://mecrisp-stellaris-folkdoc.sourceforge.io/rpi-pico.html#the-pico-mandlebrot-challenge

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 26, 2021, 11:21:19 pm
content: Well, there is an assembly source, but no Forth source code to be seen? Isn't mecrisp stuff meant to be Forth?I would have been curious to take a look at the Forth code for this.

author: techman-001
author_rank: Frequent Contributor
timestamp: February 27, 2021, 01:58:20 am
content: Quote from: SiliconWizard on February 26, 2021, 11:21:19 pmThe Mecrisp-Stellaris architect wrote the Mandlebrot challenge in Assembly as his aim was minimal binary size.Mecrisp-Stellaris is 100% Assembly itself and its users are conversant in both languages.

author: hamster_nz
author_rank: Super Contributor
timestamp: February 27, 2021, 04:40:11 am
content: Worth squirreling away for the H/W setup code alone... (which is about 2/3rds of the projects ~300 lines).

author: techman-001
author_rank: Frequent Contributor
timestamp: February 27, 2021, 06:02:59 am
content: Quote from: hamster_nz on February 27, 2021, 04:40:11 amPlus the toolset is all GPL'd, (like everything Mecrisp*).

author: techman-001
author_rank: Frequent Contributor
timestamp: February 28, 2021, 08:48:11 pm
content: New Release @ 1 March 2021.Prints a Mandlebrot to a serial terminal and has a breathing LED effect while waiting for keypress, all in a 252 Byte binary!Also includes a lot of extra information including emulator, fully commented assembly source and proof of concept files.Same URL:https://sourceforge.net/projects/mecrisp-stellaris-folkdoc/files/mandelboot.tar.gz

author: techman-001
author_rank: Frequent Contributor
timestamp: March 04, 2021, 04:18:52 am
content: New Release @ 4 Mar 2021.Now with Mandlebrot and Tricorn Set plus a breathing LED cosine effect while waiting for keypress.Still in a252 Bytesbinary executable for the Pico.https://mecrisp-stellaris-folkdoc.sourceforge.io/rpi-pico.html#the-pico-mandlebrot-challenge
Heartblink; assembly fading led blinky for the STM F0 Discovery Board - Page 1
Forum section: electronics / general

author: techman-001
author_rank: Frequent Contributor
timestamp: March 02, 2021, 03:05:05 am
content: A pure Assembly Language 'fading blinky' from Matthias Koch.A differential equation is numerically approximated (providing the sine/cosine/triangle function), the result interpreted as a floating point number and converted to integer (to get an exp(x) approximation) and fed into a sigma/delta modulator, the output of which drives the LED.The exp(x) approximation is to correct for human eyesightThree choices of led modulation algorithm in the Makefile, sine, cosine or triangle which compile to 58 or 60 bytes.Fully commented source here:https://mecrisp-stellaris-folkdoc.sourceforge.io/heartblink.html
Mecrosp-Stellaris-2.5.6 Forth released - Page 1
Forum section: electronics / general

author: techman-001
author_rank: Frequent Contributor
timestamp: February 28, 2021, 11:24:27 am
content: New Targets:* RP2040 on Raspberry Pico board* STM32F407 on DIYMORE board* STM32F767* STM32H743https://sourceforge.net/projects/mecrisp/files/mecrisp-stellaris-2.5.6.tar.gz
main.h a header file for the module containing main() - Page 1
Forum section: electronics / general

author: AlfBaz
author_rank: Super Contributor
timestamp: February 28, 2021, 11:25:47 am
content: Is any body else annoyed by the use of main.h or at least the name of it or have I missed some major paradigm shift.

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 28, 2021, 06:57:49 pm
content: Where have you encounteredmain.h?Perhaps it is a mis-namedconfig.h, containing compile-time configuration; perhaps auto-generated, or includes the auto-generated snippets?

author: ataradov
author_rank: Super Contributor
timestamp: February 28, 2021, 06:59:08 pm
content: What is so annoying about it? Especially is the corresponding file is main.c.main file may contain other things, not just main(). Where would you put those declarations if they need to be public?

author: ejeffrey
author_rank: Super Contributor
timestamp: March 02, 2021, 06:20:14 pm
content: This is totally reasonable. main.c is a reasonable place to define any global variables you have. If they need extern declarations main.h would be the place to put them. I would give second thought to defining any functions in main.c that need to be declared elsewhere, but that is not a hard no, just something I would carefully consider. main itself should not have a prototype, so if someone is using main.h to provide that it is a definite error.I do agree that compile time constants settings are usually better off in something called config.h than main.h.
GCC 10.x on Windows, dependencies and absolute paths - Page 1
Forum section: electronics / general

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 10, 2021, 10:54:38 pm
content: Just a quick note for anyone that would happen to use GCC 10.x (any target) on Windows (which would be pretty common if you're developing for embedded targets). The latest ARM GCC (https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) is affected - as any GCC 10.x compiler.There was a modification in the way dependencies (makedep) are generated (so for instance through the -MM option and such), and the colon ':' character is now escaped. That means that on Windows, if you're using absolute paths (which is not uncommon if you're using system-wide SDKs, libraries, etc.), the dependencies will be messed up - basically unusable. A backslash will be added before each ':' in dependency rules, which is not a valid Windows path. So that makes the build fail. Eg.: "D:\SomePath" will become "D\:\SomePath" => invalid.There is currently no workaround that I know of, except either using only relative paths, or using an earlier version of GCC (max. 9.x). Or not using auto-generated dependencies through GCC - but it's pretty handy. Or, of course, not using Windows.The regression has been handled and the fix should be available in the next 10.3 version:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95253
Notch filter in matlab - Page 1
Forum section: electronics / general

author: harrysmith
author_rank: Contributor
timestamp: January 23, 2021, 04:01:17 pm
content: Hi everyoneI tried with this code but I did not have the template of a notch filtera=20; %orderfs=1000; %sampling frequencyf1=400/fe;f2=600/fe;wn1=2*f1;wn2=1-2*f2;N1=(a-1)/2;n=-a/2 : a/2;hn=wn1*sinc(wn1*(n-N1))+wn2*sinc(wn2*(n-N1)).*cos(pi*(n-N1));[H,f]=freqz(hn,1,250,fs);figure(1)plot(f,abs(H));is there any other code to have an ideal notch filterTHanks

author: Mau5
author_rank: Newbie
timestamp: January 31, 2021, 09:32:49 am
content: Hi,This is my first post on this forumYou can create a notch filter based on an IIR-Filter type.The transfer function is:H(z) = (1 - 2 * cos(w) * z^(-1) + z^(-2)) / (1 - 2 * p * cos(w) * z^(-1) + p^2 * z^(-2))Whereas w is the normalized frequency that you want to remove (w = 2 * pi * f / fs).p is a parameter in the range of [0,1]. It determines the radius of the pole location on the unit circle. The closer it is to 1, the narrower the notch bandwidth.For your problem, you can now put two single notch filters in series.Here an example code: I hope it is formatted correctlyCode:%% Notch Filter Testclear;clc;fs = 1000; % Sampling frequency f1 = 100; % Notch filter frequency 1 f2 = 200; % Notch filter frequency 2 %% Design Notch filter for first frequency%H(z) = (1 - 2 * cos(w1) * z^(-1) + z^(-2)) / (1 - 2 * p * cos(w1) * z^(-1) + p^2 * z^(-2))p = 0.99; % The closer to one, the narrower the notch bandwidthw1 = 2*pi*f1 / fs; % Convert f1 to normalized frequency [+-2*pi]num1 = [1 , -2 * cos(w1), 1]; %IIR-Filter coefficients for numerator 1denum1 = [1. -2 * p * cos(w1), p^2]; %IIR-Filter coefficients for denumerator 1%% Design Notch filter for second frequencyw2 = 2*pi*f2 / fs; % Convert f2 to normalized frequency [+-2*pi]num2 = [1 , -2 * cos(w2), 1]; %IIR-Filter coefficients for numerator 2denum2 = [1. -2 * p * cos(w2), p^2]; %IIR-Filter coefficients for denumerator 2%% Connect filter parameters in seriesnum = conv(num1,num2); %IIR-Filter coefficients numeratordenum = conv(denum1,denum2); %IIR-Filter coefficients denumerator%% Create Filter object and plotiir = dsp.IIRFilter('Numerator',num,'Denominator',denum);freqz(iir)Note: The vectors num and denum are the IIR-Filter coefficients. You can also plot the filter with freqz(num, denum)With the iir-object, you can directly apply the filter to some measurement data.The frequency response of this example is attatched.I hope this example code helps you

author: rstofer
author_rank: Super Contributor
timestamp: February 04, 2021, 04:12:38 pm
content: Absolutely brilliant use of MATLAB, my favorite tool.And welcome to the forum!
Beginner on TL866 needs some help - Page 1
Forum section: electronics / general

author: orgamisho
author_rank: Newbie
timestamp: January 31, 2021, 08:16:52 am
content: Hello all!I am repairing a device and to do so I have to reprogram the nand flash in it. I've successfuly read the nand and I found the data I need to change before programming it back to the nand but it seem that the data is grayed out and I can not change the cells.I am using TL866ii PLUS with xgpro v10.75 softwareThank you in advance!

author: Bicurico
author_rank: Super Contributor
timestamp: January 31, 2021, 09:23:42 am
content: You need to edit the data with a hex editor.I usually use Notepad++ with the hex editor plugin.Regards,Vitor

author: orgamisho
author_rank: Newbie
timestamp: January 31, 2021, 11:28:02 am
content: Unfortunately Notepad++ coould not open the file as it is doo big, but tried with a different hex editor and it worked!Thank you!
Reading Back - Page 1
Forum section: electronics / general

author: nfmax
author_rank: Super Contributor
timestamp: January 29, 2021, 09:40:02 am
content: Recently, I've been re-reading some 'classic' texts from my university years and after, to pass the time. Most recently, Gerald M. Weinberg,The psychology of computer programmingfrom 1971. In a section on personality testing, it contains this gem, which I couldn't resist sharing:Quote
Arduino String questions - Page 1
Forum section: electronics / general

author: NW27
author_rank: Regular Contributor
timestamp: January 28, 2021, 08:53:53 pm
content: Good Morning,I'm using the ESP32 and VScode PlatformIO IDE and I have a couple of String related questions:1. What is the difference between "String" and "string"? I can declare variables with either- String test1 = "test1";- string test2 = "test2";2. The below printLocalTime function sends out the required DateTime on the serial port.I would like to have this as a global string.After looking on the web, the below Print::print function was put forward but I do not understand a) how to call this and b) how it returns a stringCode:size_t Print::print(struct tm * timeinfo, const char * format){const char * f = format;if(!f){f = "%c";}char buf;size_t written = strftime(buf, 64, f, timeinfo);print(buf);return written;}void printLocalTime(){struct tm timeinfo;if(!getLocalTime(&timeinfo)){Serial.println("Failed to obtain time");return;}Serial.println(&timeinfo, "%Y-%m-%d %H:%M:%S");}

author: ledtester
author_rank: Super Contributor
timestamp: January 28, 2021, 09:17:59 pm
content: Based on this discussion:https://forum.arduino.cc/index.php?topic=670228.0"String" is a string class provided by the Arduino library. It allocates space for the string on the heap. Apparently it is a slimmed-down version of "std::string"."string" is likely to be "std::string" which is the C++ class for strings. It also allocates space on the heap for storage."char *" is the basic C-style string. Constants are stored pre-allocated in global memory. Otherwise you have to allocate storage yourself.Lots of routines like Serial.print accept either a "String" or "char *". Your "Print::print" function, however, only accepts a "const char*" argument. To convert a String to char* you can use either toCharArray() or getBytes() method. However, you will still need to provide space for the resultant C-style string, i.e. something like this:Code:size_t Print::print(..., String format) {char *format_buf;...format.toCharArray(format_buf, 64);size_t written = strftime(..., format_buf, ...)...Note that in this example only the first 64 characters of the input String format will be passed to strftime.
Anything similar to "LazyGit" but written in C/C++? - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: January 22, 2021, 07:29:28 pm
content: "LazyGit" is a very useful tool to manage "git". Unfortunately for me it's written in Go and I cannot compile.Is there anything similar to it but written in C/C++?Currently I am using "Tig"

author: techman-001
author_rank: Frequent Contributor
timestamp: January 22, 2021, 11:23:04 pm
content: Quote from: DiTBho on January 22, 2021, 07:29:28 pmNot C/C++ but how about Rust ?https://pepa.holla.cz/2020/08/17/gitui-blazing-fast-terminal-client-for-git-written-in-rust/

author: ve7xen
author_rank: Super Contributor
timestamp: January 22, 2021, 11:37:18 pm
content: I was going to suggest `tig`, but why can't you compile or run one of the binaries provided for many operating systems?

author: DiTBho
author_rank: Super Contributor
timestamp: January 23, 2021, 05:23:26 am
content: Quote from: ve7xen on January 22, 2021, 11:37:18 pmThere is no Go compiler for what I am trying to support.

author: DiTBho
author_rank: Super Contributor
timestamp: January 23, 2021, 12:52:12 pm
content: Also I was thinking about a Go to C compiler for Linux, but contrary to my expectations, cross compiling to C would reduce Go's cross platform support, not improve it.Not a good idea.
LZ4 decompression - Page 1
Forum section: electronics / general

author: HwAoRrDk
author_rank: Super Contributor
timestamp: January 22, 2021, 10:30:51 pm
content: I've been writing some C code to implement LZ4 block decompression. I have a working implementation, but there is one aspect of the 'spec' (if you can call it that) that I am unsure of.It concerns the scenario where the match offset plus the match length is greater than the current output position - that is, there is an overlap. Theblock format documentationhas this to say about it:QuoteI don't understand how this should be handled. There is no further elaboration.Onthis blog postI found suggestion that this is somehow some kind of run-length-encoding. But again, no elaboration.I have looked at several open-source implementations of LZ4 block decoding logic, and none of them seem to handle this 'overlap' scenario. Is this perhaps something that is not actually required because no extant compressors/encoders actually produce blocks like this?Any help from anyone with knowledge would be most appreciated.

author: Nominal Animal
author_rank: Super Contributor
timestamp: January 22, 2021, 11:17:33 pm
content: Let's say the current buffer contents (from lower to higher addresses) isabcdef, and you have a match atdof length 8. The end result isabcdefdefdefde.This is common, as this way the encoder only needs to have the first repeating sequence in the buffer, and it can be repeated any number of times.This does need some care to handle correctly, because the standard C library does not have a function to do this; it is the opposite of memmove() with respect to memcpy(), and I like to call it memrepeat(). If you use an open-coded loop to fill/emit the data, there is no problem (and no special handling is needed), because the destination-source delta stays constant.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: January 22, 2021, 11:58:55 pm
content: Oh, I think I understand now!So with your example, a simple copy loop (not using stdlibmem*()functions) would go like the following, automatically handling the situation:abcdef^abcdefd^abcdefde^abcdefdef^abcdefdefd^abcdefdefde^abcdefdefdef^abcdefdefdefd^abcdefdefdefdeSo if my code is currently as follows, it should already handle this, right?Code:const uint8_t *copy_src = out - copy_off;while(copy_len-- > 0) *out++ = *copy_src++;Thanks!

author: ejeffrey
author_rank: Super Contributor
timestamp: January 23, 2021, 12:19:12 am
content: Yep. This is a pretty standard way to handle repetitive strings in dictionary based compression algorithms.You could run into trouble if you tried to optimize by copying multi-byte words, or if you used memcpy which has an unspecified overlap behavior.Thats probably why it looked like the implementations you saw didn't handle this: they were doing it fine but no special care is needed except to avoid doing something tricky.
DB LTC6811 with Arduino Uno - Page 1
Forum section: electronics / general

author: lorenrus
author_rank: Regular Contributor
timestamp: January 21, 2021, 02:30:34 pm
content: Hi everyoneI'm trying to communicate with the LTC6811 demo board.I connected directly from the Arduino pins to the J2 connector on the demo board.Arduino - LTC J2D13 (SCK) - SCKD12 (MISO) - SDO (pull up with 5k)D11 (MOSI) - SDID10 (CS) - CSBAlso I put the jumpers JP2, JP1, JP3 in the zero position, because I want to use the 4-wire SPI.I monitored the MOSI line with the oscilloscope but I am not receiving anything.I always get back that there is a problem with the PEC.Can you help me ?Thank you
Has Proton PIC Basic Compiler gone away? - Page 1
Forum section: electronics / general

author: jmarkwolf
author_rank: Regular Contributor
timestamp: January 15, 2021, 09:56:32 pm
content: I was a frequent user a few years back, but went to renew my credentials on the forum, which have of course expired, tried to re-register but have heard nothing back.Tried to download the latest compiler from some Google source but Norton said it was suspect and to delete it.Can anyone advise?

author: Gyro
author_rank: Super Contributor
timestamp: January 16, 2021, 11:57:12 am
content: Hmm, the website does look different now. Everything is in archives.The latest, and previous versions of the compiler is still available on the site though (without logging in)...http://pds.protonbasic.co.uk/Files/
Animated ASCII Donut  - Page 1
Forum section: electronics / general

author: hamster_nz
author_rank: Super Contributor
timestamp: January 13, 2021, 10:29:28 pm
content: I was helping somebody port this "ASCIIart animated Donut" to C:https://www.a1k0n.net/2011/07/20/donut-math.htmlIt struck me that it would just fit onto one of my posters. So I made the poster below.Have added C source if anybody wants to play with it - can supply the A2 300DPI image if anybody wants it.
Sampled signal spectrum ? - Page 1
Forum section: electronics / general

author: harrysmith
author_rank: Contributor
timestamp: January 06, 2021, 08:36:09 pm
content: Hi guys, someone knows the matlab program to plot a the spectrum of a sampled signal ; example : signal x(t) ? thanks

author: tggzzz
author_rank: Super Contributor
timestamp: January 06, 2021, 09:59:50 pm
content: The answer is in your other thread.
Project Based Coding Editor with FTP (Dreamweaver Alternatives?) - Page 1
Forum section: electronics / general

author: KungFuJosh
author_rank: Super Contributor
timestamp: November 23, 2020, 07:19:41 pm
content: Hi,I'm looking for a Dreamweaver alternative. I don't care at all about the visual editor. What I need is:Advanced text editor with code hinting, and color codingProject system to store project and FTP infoFTP / SFTP etc... supportCompatibility on both Windows and Mac would be nice, but options for both are also fine.I haven't found anything great. Just text editors with some form of FTP support, but nothing great for maintaining everything based on projects.Thanks,Josh

author: bd139
author_rank: Super Contributor
timestamp: November 23, 2020, 07:59:07 pm
content: Try VSCode:https://code.visualstudio.com/There are numerous FTP plugins for it. Works on Mac and Windows. Has built in project support etc and you can keep meta-info like ftp servers in it.

author: kripton2035
author_rank: Super Contributor
timestamp: November 23, 2020, 10:15:17 pm
content: SublimeText is nice too for that.

author: KungFuJosh
author_rank: Super Contributor
timestamp: November 23, 2020, 10:36:07 pm
content: Quote from: bd139 on November 23, 2020, 07:59:07 pmThanks! That looks like it's evolved a lot since the last time I looked at it. I'm gonna try it out.Quote from: kripton2035 on November 23, 2020, 10:15:17 pmThat editor looks nice, but it doesn't appear to have any FTP support yet?

author: PlainName
author_rank: Super Contributor
timestamp: November 24, 2020, 02:30:46 am
content: Slickeditshould cover your requirements. Been around for quite a long time (I moved to it in 2005 after falling for Underware's Brief and then spending nearly a decade trying to find a perfect replacement when that went under), so they have a clue as to what they're doing. Product support is very good indeed. I don't use FTP myself but there is good support for it.'Tain't free, though. OTOH, it's one of the few remaining apps I cough for extending maintenance every year without thinking about it. I'd pay that fee just for the preview window, and that's a minor feature

author: KungFuJosh
author_rank: Super Contributor
timestamp: December 27, 2020, 06:03:41 pm
content: It looks like Visual Studio Code is the best option presented. With the help of a few plugins (Project Dashboard, SFTP, and a few others) it does everything I want the best, and doesn't look like it's from 1992. All the other options still needed plugins to meet all the needs (if they even could), and still did it very clunkily. I wish some company would just copy the feature set from Dreamweaver and make life simple. lol
Rom Address with Microchip MPLABX and XC8 - Page 1
Forum section: electronics / general

author: Picuino
author_rank: Super Contributor
timestamp: April 14, 2020, 10:27:50 am
content: I have updated MPLABX from version 4 to version 5 maintaining the compiler XC8 with version 2.1Before update, this code worked:Code: (c)#define SAF_ADDRESS 0x3F80 // Storage Area Flash addressconst unsigned long PPB_CALIBRATION @ SAF_ADDRESS = 248444;And now the compiler raise an error:Code:./calibration.h:11:36: error: expected ';' after top level declaratorconst unsigned long PPB_CALIBRATION @ SAF_ADDRESS = 248444;^;how can i make it work now?Regards.

author: oPossum
author_rank: Super Contributor
timestamp: April 14, 2020, 12:24:39 pm
content: Use __at(address)Section 2.5.2.3 of MPLAB_XC8_C_Compiler_Legacy_User_Guide.pdf

author: Picuino
author_rank: Super Contributor
timestamp: April 14, 2020, 01:11:04 pm
content: Thanks a lot.

author: 741
author_rank: Frequent Contributor
timestamp: November 19, 2020, 04:32:04 pm
content: I have spent nearly a day tracing this in a 2017 project. The @ symbol occurs in the usb framework code from around that time (in fileusb_hal_pic16f1.h).The section referred to is entitledMIGRATION TO THE CCIAlso, the documentMPLAB_XC8_C_Compiler_User_Guide_for_PIC.pdf, 50002737C-page 567 says this(2036) use of @ is not compliant with CCI, use __at() instead (Parser)The CCI does not permit the definition of absolute functions and objects that use the @ address construct. Instead,place __at(address) after the identifier in the definition.int foobar @ 0x100; // oops -- use __at(0x100) insteadBut my projectdoes not have the "Use CCI Syntax" checkbox checked... So why the error?XC8 v2.20Update: I found this post on the Microchip forum (https://www.microchip.com/forums/m1058706.aspx), it seems the errors also relate to C99 mode being the new default (but only since XC8 v2.00).Whole can of worms...(It is interesting that C99 only now makes it to default in 2020! )
Debug python - Error: No main class specified? - Page 1
Forum section: electronics / general

author: elenaflorence
author_rank: Newbie
timestamp: October 27, 2020, 05:35:51 am
content: I installed Intellij 2019 with python plugin. And I opened a directory with python scripts. I'm going to debug script1.py in the directory.In the "Project Structure" window, I added new Python in the field "Project SDK".Then, I went to "Run/Debug configurations" folder and clicked the + and added a new Application, I need an command line argument so I filled the field "Program arguments:" with my arguments.However, at the bottom it shows a read error message: "Error: No main class specified". And I cannot run the python script. What I missed to set up the intellij to runpythonscript?