hybridfree/eevblog-posts huggingface dataset:
MMBasic - The MicoMite - Finally pushed over the edge - Page 1
Forum section: electronics / general

author: g0mgx
author_rank: Regular Contributor
timestamp: December 07, 2019, 04:09:02 pm
content: Hi GangI've been developing some code on the micromite:https://micromite.org/micromites/It is designed to use MMBasic and I have writing for my target which is a PIC32MX170F256B.My recent code issues have boiled down to some basic maths that isn't producing the results I expect.Simple example below:Code:SUB DoStuffLOCAL AS INTEGER INT_ALOCAL AS FLOAT FLOAT_BLOCAL AS INTEGER INT_CLOCAL AS FLOAT FLOAT_DINT_A = 456 * 8 'expect 3648FLOAT_B = INT_A / 10 'expect 364.8INT_C = FIX(FLOAT_B) 'expect 364FLOAT_D = FLOAT_B - INT_C 'expect 0.8print "INT_A" ; INT_A ' this prints 3648PRINT "FLOAT_B" ; FLOAT_B ' this prints 364.8PRINT "INT_C" ; INT_C ' this prints 364PRINT "FLOAT_D" ; FLOAT_D ' this prints 0.799988 !?!?!?!ENDSUBI'm actually calculating register values for a PLL, but I have traced my issues to the inacuracies I reproduce above.Can anyone help me understand why, when I do 364.8 - 364 I get 0.799988Grateful for any sanity saving pointers or perhaps a better way to just get the remainder from a real number division. The FIX function gives me the quotient but I cant find the function to give me the remainder.Thanks

author: andersm
author_rank: Super Contributor
timestamp: December 07, 2019, 05:48:23 pm
content: Floating point math is not exact. The value 0.8 can't be expressed using standard IEEE754 floating point. There's a ton of material available on the subject, including guides on best practices when using floating point numbers in your code.

author: nali
author_rank: Frequent Contributor
timestamp: December 07, 2019, 05:51:46 pm
content: Quote from: g0mgx on December 07, 2019, 04:09:02 pmIsn't that the MOD operator?

author: g0mgx
author_rank: Regular Contributor
timestamp: December 07, 2019, 07:41:31 pm
content: I was looking for a math function, MOD is indeed there, but an operator.Thanks

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: December 13, 2019, 03:07:59 pm
content: Quote from: g0mgx on December 07, 2019, 04:09:02 pmBecause that is the accuracy you get with FLOAT.https://en.wikipedia.org/wiki/Floating-point_arithmeticThe real question is why are you using FLOAT for integer calculations?
Security flaws in Wind River's IPnet  embedded TCP/IP stack - Page 1
Forum section: electronics / general

author: splin
author_rank: Frequent Contributor
timestamp: October 04, 2019, 05:44:33 pm
content: Quotehttps://www.theregister.co.uk/2019/10/02/fda_ipnet_alert/Not exactly a surprise, but potentially a big problem for products with embedded stacks, most having no prospect of getting firmware updates even if owners get to know there is a problem. The article doesn't suggest that the flaws have been exploited (yet) and you would hope that such equipment would be behind a decent firewall, but that isn't sufficient to ensure safety. I guess most embedded kit with TCP/IP stacks use it to provide a Web interface for control purposes and that the main danger would be equipment that connects to an external server for DRM/licencing/billing/update purposes?Using a commercial, supported product rather one of the free offerings such as LwIP doesn't necessarily help - at some point the stack vendor will drop support or go out of business. If you have access to the source code you at least have the chance to fix the code, although getting the updated firmware installed in all the products you've sold is another matter.Is it likely that you, as a manufacturer of an embedded product with a TCP/IP stack, could get sued if a customer suffers loss that can be traced to a security flaw in your product? Obviously that is going to depend on where you, and your customers are in the world. OTOH security vulnerabilities don't seem to worry the likes of router manufacturers who rarely bother to offer updates - let the customer buy the latest version (with its own unique set of bugs) if they're worried.

author: pepelevamp
author_rank: Regular Contributor
timestamp: December 02, 2019, 11:02:40 pm
content: yeah this kinda thing bothers the crap out of me.theres a zillion dollars put into safety & compliance for the hardware and then they shove on some fart in a jar operating system / firmware and leave you with it.i just think some things shouldn't have a stack. i dont need to ping my light bulb. my flatmates light bulb on the network here never shuts up.
Adapting the Arduino IDE for certain Linux-based SBCs - Page 1
Forum section: electronics / general

author: Scratch.HTF
author_rank: Regular Contributor
timestamp: November 07, 2019, 07:22:11 am
content: With a quick search, I came across RasPiArduino which enables Arduino sketches to run on the Raspberry Pi with hardware support for I2C/SPI/UART (I've seen a similar tool for the BeagleBone as well).But I wish to run Arduino sketches on other Linux-based SBCs (the one I am talking about is based on the HiSilicon KIRIN 970 - ARM64), so what are some general guidelines for adapting RasPiArduino (or similar specified tool) to other SBCs including making use of hardware functions (I2C, SPI, UART etc. which can include multiple ports for each hardware function)?

author: rstofer
author_rank: Super Contributor
timestamp: November 07, 2019, 09:18:46 pm
content: TeensyDuino seems to do a similar thing in that it allows Arduino(like) sketches to run on an ARM processor. Teensy 4.0 is one of the new boards.In effect, there are libraries that contain all of functions of the Arduino libraries and they are named the same and have the same parameters. The underlying hardware is nowhere near identical.https://www.pjrc.com/store/teensy40.htmlIt seems like a pretty big project!

author: wnorcott
author_rank: Regular Contributor
timestamp: November 09, 2019, 01:53:33 am
content: You can but maybe explain what’s the end goal? If you want to run a much more powerful than Arduino device that supports IDE and also a much wider array of dev environments I would suggest you look into the ESP32 that has integrated Wifi is much faster and more of everything an Arduino would have. ESP32 supports virtually the entire set of Libs now including peripherals. For about five dollars.It also gets around all the TTL level conversion 5 V hassles causes by arduino platformNow if its a Arduino emulator you want to run on Pi or BeagleBone having the BB for example as both emulator and dev platform that would be interesting. On the other hand turning a BB into an arduino seems like a huge waste of both Linux and the H/W. Beaglebone especially with its zillion GPIO pins and the two dedicated realtime compute units separate from the GPU.
USB OTG device Communication - Page 1
Forum section: electronics / general

author: Peili
author_rank: Regular Contributor
timestamp: October 30, 2019, 05:13:41 am
content: Hi,A device that sits betweenthe PC and USB Printer thus capturing all the data that has been pushed to printer. PC shall assume the device to be the printer and hence push the data , which will further push the data to the connected printer.I have tried withOrangePi zero over USB OTG device. Now my pc detects OrangePi zero asg_printerand i could initiate print to this. But i cannot capture anything at the OTG side. I cannot read printer status of g_printer.How can i trouble shoot to identify the communication?I have just followed thishttps://www.kernel.org/doc/Documentation/usb/gadget_printer.txt

author: MosherIV
author_rank: Super Contributor
timestamp: October 30, 2019, 09:37:14 pm
content: It sounds like you are trying to build your own USB protocol analyser.Have you tried Wireshark with a usb plug in to capture the usb traffic before it leaves the pc?

author: Peili
author_rank: Regular Contributor
timestamp: November 02, 2019, 04:46:56 am
content: Yes.. i tried with Wireshark to capture my USB packet.. I'm attaching the USB packet when i gave a print to the 'G_printer' Gadget. Attaching the screen shots of gadget to hat and host to gadget
STM32H743VIT6 Black Board - Page 1
Forum section: electronics / general

author: ralphrmartin
author_rank: Frequent Contributor
timestamp: October 26, 2019, 08:01:26 pm
content: It's now possible to purchase STM32H743VIT6 development boards at quite a low price from China, but I am having a hard time finding any documentation like circuit diagrams, example code, etc, despite vendors saying they are available.Does anyone have any URLs from which these could be downloaded, or other pointers, please?

author: ralphrmartin
author_rank: Frequent Contributor
timestamp: October 27, 2019, 07:02:39 pm
content: I've now got a blinky working for it using STM32CubeIDE. I guess the rest should be easy.[Gripe on] Why can't STM release software that works? I tried using STM32CubeIDE on a Mac, only to find out that you can't run programs with it - it looks for the elf file in a location that mixes Mac / directory separators with Windows \ ones. It's very clear no one even gave this the rudimentary test of "build a project, program it into a device and run it". I'm shocked that the quality control is so awful at a company which is supposed to be one of the big players. If their attention to software quality is this awful, what can their hardware be like? Oh, I see, a 39 page errata sheet for the STM32H743. How can anyone take them seriously? [Gripe off].
any *good* multi uart miniPCI card for a router? - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: October 08, 2019, 01:15:51 pm
content: I need 8 UART-ports able to run at {115200 .. 1M } bps. I am experimenting with some weird problems with a couple of miniPCI modules, each able to manage up to 4 ports.One thing I do find irritating: this stuff does not respect the PCI spec concerning how to report resources to BAR, in fact the Linux kernel has to handle the card in the pic via "quirks"The miniPCI card in the pic comes with fixed addresses (not reprogrammable => this violate the "plug and play" mechanism), hence it needs quirks and tricks to avoid collisions.This is not perfect, and kernel 4.9.* to kernel 4.11.* are *ALL* bugged.Does anyone happen to know a *good* multi serial miniPCI module? which fully do respect the PCI spec?

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 09, 2019, 01:51:08 am
content: Find one to go from miniPCI to USB, then add some USB to serial converters.

author: legacy
author_rank: Super Contributor
timestamp: October 09, 2019, 06:11:14 am
content: Quote from: NiHaoMike on October 09, 2019, 01:51:08 amdo you happen to know where can I find one? EHCI? NEC chip?

author: legacy
author_rank: Super Contributor
timestamp: October 09, 2019, 06:19:12 am
content: with an ugly ( too embarating, so I will never show a pic) hardware and software hack, it seems you can partially work-around the problemCode:PCI: Enabling device 0000:00:05.0 (0000 -> 0003)0000:00:05.0: ttyS1 at I/O 0x18800800 (irq = 140, base_baud = 460800) is a 16C950/9540000:00:05.0: ttyS2 at I/O 0x18800808 (irq = 140, base_baud = 460800) is a 16C950/9540000:00:05.0: ttyS3 at I/O 0x18800810 (irq = 140, base_baud = 460800) is a 16C950/9540000:00:05.0: ttyS4 at I/O 0x18800818 (irq = 140, base_baud = 460800) is a 16C950/954PCI: Enabling device 0000:00:0a.0 (0000 -> 0003)0000:00:0a.0: ttyS5 at I/O 0x18800840 (irq = 140, base_baud = 460800) is a 16C950/9540000:00:0a.0: ttyS6 at I/O 0x18800848 (irq = 140, base_baud = 460800) is a 16C950/9540000:00:0a.0: ttyS7 at I/O 0x18800850 (irq = 140, base_baud = 460800) is a 16C950/9540000:00:0a.0: ttyS8 at I/O 0x18800858 (irq = 140, base_baud = 460800) is a 16C950/954by forcing the two module to avoid address collisions, thank to a secondary SoC supporting chip, that only adds an offset of { 0x00, 0x40 } depending on how you set a GPIO pin. This is really ugly, but it works. Well, ... it works ... actually, it allows the two cards to avoid collision, but, I cannot solve the shared irq problem, hence this stuff comes with extremely ugly interrupt handler in kernel space
Will an out of the box Raspberyy Pi 3+ see wireless mouse and keyboard? - Page 1
Forum section: electronics / general

author: Chris Wilson
author_rank: Super Contributor
timestamp: October 01, 2019, 04:06:18 pm
content: Newbie question sorry, but will a new Raspberry Pi 3+ loaded with the "Noobs" OS see a wireless mouse and keyboard or do they need to be hard wired USB ones, at least initially? Many thanks! Oooh 1000 posts and a Super Contributor, but I am afraid I take a lot more than I give here...

author: brucehoult
author_rank: Super Contributor
timestamp: October 01, 2019, 11:46:02 pm
content: Most "wireless" mice and keyboards use a small transceiver that plugs into a USB port. To the PC they look exactly the same as wired USB peripherals and work fine even for entering BIOSes etc.Some mice and keyboards are advertised as "BlueTooth" rather than generic "wireless" in which case they need support from the OS (and BIOS if you want to use them that early). You can use these with a Pi but you need to be able to operate the Pi some other way (another keyboard, ssh) in order to set it up initially.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 04, 2019, 02:21:09 pm
content: Note that RPis don't have any kind of "BIOS" per se, they just have a firmware that is completely unaccessible to the user (it can be configured with a text file on the SD card, and that's all.) So there's nothing to care about outside of the OS you're going to use.So yeah, some or most of the wireless "dongles" for keyboards and mice are seen as HID devices from the OS POV, so they are recognized with no problem and yes, if you're dealing with bluetooth, check that the OS you're going to use supports it, and particularly supports bluetooth keyboards and mice. Any decent Linux distro with a decent desktop env. should, but I don't know much about the "Noobs" distribution.

author: Chris Wilson
author_rank: Super Contributor
timestamp: October 04, 2019, 02:41:37 pm
content: Booted it up last night and it saw both the mouse and keyboard RF "dongles" fine and was up and running with no need for any messing. Many thanks for the advice!

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 04, 2019, 04:31:22 pm
content: Cool.Just for the record: the embedded firmware that runs upon reset on the Pi's actually runs on the GPU (Videocore) and not on the CPU.It initializes a number of things before handing execution to the CPU, which then executes code from what's on the SD card.
Yocto rootvg recipe- socfpga without busybox - Page 1
Forum section: electronics / general

author: blacksheeplogic
author_rank: Frequent Contributor
timestamp: September 21, 2019, 11:26:51 pm
content: Anyone have a starting recipe to build rootvg without busybox for a socfpga.

author: andersm
author_rank: Super Contributor
timestamp: September 22, 2019, 10:36:08 am
content: This thread has a method that may work (read the whole thread!):https://lists.yoctoproject.org/pipermail/yocto/2018-February/039993.html

author: blacksheeplogic
author_rank: Frequent Contributor
timestamp: September 22, 2019, 09:27:40 pm
content: Quote from: andersm on September 22, 2019, 10:36:08 amThank you, this is very helpful.
arduino_debug & NotePad++ - Page 1
Forum section: electronics / general

author: IanJ
author_rank: Unknown
timestamp: October 31, 2019, 05:37:54 pm
content: Hi all,I've set up NPPEXEC in NPP in order to compile and upload to my atmega1284 AVR using arduino_debug.exe, i.e. command line control of the IDE effectively...........So, no more IDE, and all within NPP. Just hit F6.However, I can't see how to burn bootloaders with it............any ideas?For reference, here's what I have so far (NPPEXEC execute scripts):-COMPILE & UPLOAD - REQUIRES IDE TO BE LAST SAVED WITH REQUIRED BOARD, PROGRAMMER CONFIGURED ETC.:-set arduino_path = "C:\Program Files (x86)\Arduino-1.8.9\arduino_debug"cmd /c $(arduino_path) --verbose-build --useprogrammer --verbose-upload --upload $(full_current_path)COMPILE & UPLOAD - OVERRIDES PREVIOUS IDE SELECTIONSset arduino_path = "C:\Program Files (x86)\Arduino-1.8.9\arduino_debug"cmd /c $(arduino_path) --verbose-build --board IanJ_1284:avr:IanJ_1284 --useprogrammer --verbose-upload --upload $(full_current_path)COMPILE ONLYset arduino_path = "C:\Program Files (x86)\Arduino-1.8.9\arduino_debug"cmd /c $(arduino_path) --board IanJ_1284:avr:IanJ_1284 --verify $(FULL_CURRENT_PATH)Ian.

author: iMo
author_rank: Super Contributor
timestamp: November 02, 2019, 05:09:04 pm
content: What is your programmer?
ppc405gp, uboot is too slow with tftpboot and diskboot - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: September 22, 2019, 11:41:51 am
content: Code:# diskboot 10000 0:2Loading from ide device 0, partition 2:Name: kernelType: Apple_UNIX_SVR2, uImage..... doneCode:# diskboot 3000000 0:3Loading from ide device 0, partition 3:Name: rootfsType: Apple_UNIX_SVR2, raw..... doneSo, I have added a couple of features to u-boot to have the possibility to support microdrive in true_IDE mode and to load in ram the content of any partition.A lot of work, not it works, but ... performance is not so good.~8MB, load_time_via_tftpboot=12sec, load_time_via_diskboot=7sec~70MB, load_time_via_tftpboot=104sec, load_time_via_diskboot=65sectftpboot is an option, there was a bug preventing the Ethernet to auto-negotiate the 100Mbps speed, now the problem is solved, but again ... performance is not so good.So I wonder about the most likely performance fault location on a u-boot on PPC405GPanyone has ever worked on it?
Ultibo, bare-metal programming RPis - Page 1
Forum section: electronics / general

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 12, 2019, 11:01:45 pm
content: The Ultibo project looks interesting:https://ultibo.org/Basically for bare-metal programming RPis. It uses Freepascal. I know some people on this forum actually like Pascal, so that could be a compelling reason to try this. For others, well, Freepascal supports Object Pascal/Delphi dialects, so that's pretty powerful.I haven't played with Ultibo yet, but I was planning on buying a couple RPi4, so I will probably try it when I get a chance.For those more inclined to using C, you can take a look at this:https://github.com/BrianSidebotham/arm-tutorial-rpiof course that's mainly just tutorials and example code, not nearly as polished as the above.
Linux i2cdetect generates nothing on SCLK - Page 1
Forum section: electronics / general

author: kishores
author_rank: Newbie
timestamp: August 04, 2019, 02:39:32 pm
content: Hi guys,I am trying to interface an IO expander MCP23017 with Nano Pi Neo2 . I am using Friendly ELEC's Ubuntu 16.04 OS .I am able to enable I2C 0 on the device and can find a device /dev/i2c-0 on the system .However , I am not able to find the IO expander device at address 0x22 when I run i2cdetect . I have checked the signals on respective SCLK and get absolutely nothing . What options do I have besides changing the OS ?

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 04, 2019, 04:16:23 pm
content: Do you have pullup resistors on the bus?

author: kishores
author_rank: Newbie
timestamp: August 04, 2019, 04:20:26 pm
content: Yes . Even without the pullups I should be able to get some signal on them , right ?

author: andersm
author_rank: Super Contributor
timestamp: August 04, 2019, 04:39:24 pm
content: Some boards need to load a device tree overlay, or adjust some other boot parameter to configure the I/O. I think FriendlyElec has a tool called "npi-config" that lets you enable and disable peripherals.

author: mikerj
author_rank: Super Contributor
timestamp: August 25, 2019, 12:46:53 pm
content: Quote from: kishores on August 04, 2019, 04:20:26 pmNo, an I2C bus cannot operate without pull-ups.

author: magic
author_rank: Super Contributor
timestamp: August 25, 2019, 05:54:01 pm
content: If SCLK is permanently LOW, try pullups. If it's permanently HIGH, it has to be something else.Are you sure you are probing the right I2C bus and not, for example, some display output?

author: nctnico
author_rank: Super Contributor
timestamp: August 25, 2019, 10:31:38 pm
content: SCLK is typically a naming convention for an SPI bus. On I2C you'd be looking for SCL (from SCL and SDA).

author: BMK
author_rank: Regular Contributor
timestamp: August 26, 2019, 12:03:09 am
content: With A64 it is easy to miss that there are multiple I2C buses. I2Cdetect needs to be given the appropriate bus number.
Datasheet for TB6576FG - Page 1
Forum section: electronics / general

author: lukecorp14
author_rank: Newbie
timestamp: August 22, 2019, 11:17:29 pm
content: I need a datasheet for an Toshiba chip Called TB6576FG it is a TQFP or QFP 64 package that is all I know about it I need it for a world changing project.

author: langwadt
author_rank: Super Contributor
timestamp: August 22, 2019, 11:22:02 pm
content: Quote from: lukecorp14 on August 22, 2019, 11:17:29 pmyou want to change the world and can't use google?
MOVED: Tips in getting into ARM Cortex M7 processors and external memory (imxRT1020) - Page 1
Forum section: electronics / general

author: crayon
author_rank: Newbie
timestamp: November 08, 2019, 03:09:14 pm
content: This topic has been moved toMicrocontrollers.https://www.eevblog.com/forum/index.php?topic=217628.0
SIO1036-ZG super IO - full datasheet? - Page 1
Forum section: electronics / general

author: zitt
author_rank: Regular Contributor
timestamp: August 20, 2019, 02:04:56 am
content: Does anyone have the full SIO1036-ZG Super IO datasheet? SMSC now MicrochipI'm look for a datasheet which has the critical information such as operating voltages, pinouts, reference designs, and programming references.Why?Well; this chip is only 36pins... and provides a proper Parallel port.I want to see if I can design a circuit board to house this chip and connect it to the LPC port of a Udoo X86?Why you ask? Well; simply put I want to see if it can be done... and two) I want to use the udoo x86 to run a Needham EMP-30 eeprom programmer which will only operate with a real Printer Port. I have had zero success making it work with a usb->lpt adapter; and many on the interwebs indicate the same.Normal distributors lists the chip as obsolete; so I haven't bothered contacting Microchip for a real datasheet. Hoping someone here has it.
"Group lights" with SOnOffs - Page 1
Forum section: electronics / general

author: paulca
author_rank: Super Contributor
timestamp: August 17, 2019, 04:45:18 pm
content: So my living room has a soft lights in each corner. Normally I have to go and turn them all on, one at a time.A small light bulb moment (bad pun) and I figured if I made them all SOnOff switched I could implement firmware that would allow one switch to turn them all on/off.As this is an extension to an existing home automation system, I just added something that was needed for other things anyway, "Demands".In short, a Python UDP socket listens for JSON blobs with demands. Call it the Demand Server.So when you "long press" the button on one of the SOnOffs it publishes a demand such as:{"groupLights1": {"key":"groupLights1", "demandState":"ON"}}These are merged into a full tree of demands in an in-memory dictionary.On a TCP socket the same Python script will respond with the full JSON tree to any device that connects.An additional Python script (keeping everything modular), called "Group Light Controller" polls this data every second and if it finds the demand for groupLights1 and it has changed from it's previous value, it will send the http command to all the group.Here is a cartoon diagram of the system:The code repo:https://gitlab.com/paulcam/home_heating
There's Forth in That ! - Page 1
Forum section: electronics / general

author: techman-001
author_rank: Frequent Contributor
timestamp: July 30, 2019, 10:48:20 am
content: This is a informative video by Leon Wagner given in August 2018 at the German Forth User Group.As can be seen in the video, Forth is very much in current use, such as a high tech device, similar to a implantable RFID tag to alleviate severe back pain in humans.https://wiki.forth-ev.de/doku.php/events:ef2018:forth-in-that

author: EEVblog
author_rank: Unknown
timestamp: July 30, 2019, 10:57:51 am
content: There is Forth in that TMS320 DSP based thingo I'm working on here:

author: iMo
author_rank: Super Contributor
timestamp: July 30, 2019, 11:28:39 am
content: Forth is great for embedded development work. For example a small Forth CPU inside an FPGA.. All you need to write the FW is a serial terminal then

author: techman-001
author_rank: Frequent Contributor
timestamp: July 30, 2019, 11:41:32 am
content: Hey Dave, you trying to hold back the C Klux Klan (CKK) who have come to burn it ?

author: techman-001
author_rank: Frequent Contributor
timestamp: July 30, 2019, 11:57:20 am
content: Quote from: imo on July 30, 2019, 11:28:39 amUnless I miss-remember, there is at least one Forth developer who mentioned he is working on something like that.He has a website here, but I don't see any mention of his Forth/FPGA project, perhaps it's ready yet.http://www.psoctools.org/

author: iMo
author_rank: Super Contributor
timestamp: July 30, 2019, 02:03:14 pm
content: If you want to play with Mecrisp Forth inside a cheapo FPGA then there are at least two directions I may point you to

author: ledtester
author_rank: Super Contributor
timestamp: July 30, 2019, 04:09:46 pm
content: Out of curiosity, is there any interest in the Forth community for a type-checked Forth?Type-checking of course could mean a variety of things, but, for instance, any Forth-to-X compiler has to check at a minimum that all code paths alter the stack in the same manner - at least for your run-of-the-mill definitions.
Using GPIO on a beaglebone in Linux - Page 1
Forum section: electronics / general

author: SimonR
author_rank: Regular Contributor
timestamp: July 19, 2019, 09:18:27 am
content: Is there a ready made Linux driver for controlling Beaglebone PIO lines in user space?My colleagues has a project prototype that is Beaglebone based and has an engineer doing the software. This engineer has done all of the clever stuff like DMA and LCD but not the keypad. He says the keypad is the most difficult as he has to write the driver from scratch since there are no examples to modify.All the key pad is are 12 buttons connected to 12 PIO lines, not efficient but really simple.Surely if there was no driver then none of the hobby/maker community would be using Beaglebone would they, there must be a driver already.

author: MosherIV
author_rank: Super Contributor
timestamp: July 19, 2019, 11:06:23 pm
content: Hi. As far as I remember, all devices are accessable as file devices.You just change directory to the devs directory, find the gpio directory, cd to the particular gpio port and then open the gpio port as a file.You can then just read them or write to them.(You may have to enable the device for user access or su login to access the port)I used to use a web site for embedded linux for this kind of info. Try elinux.orghttps://elinux.org/Beagleboard:Main_Page#BeagleBone_BlackNever tried bbb, I worked on Nvidia Jetson TK1. The pages I read on gpio was from the bbb pages.

author: MarkL
author_rank: Unknown
timestamp: July 19, 2019, 11:48:20 pm
content: Take a look in the kernel source in ./drivers/input/keyboard. There's all kinds of interrupt, matrix, and one-to-one GPIO keypad drivers.What you want is probably gpio_keys_polled.c.

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 20, 2019, 10:32:34 am
content: Quote from: SimonR on July 19, 2019, 09:18:27 amDo you mean using one of the PRUs to inject the 12 buttons as keypresses to the Linux Input subsystem, or what?If you just want to do it in userspace, you can access the GPIO pins in userspace -- use the new character device interface; see examples intools/gpio/in the Linux kernel sources --, and inject any keyboard events back into the Linux input subsystem using theuinputcharacter device. This approach works for all Linux SBCs, and has nothing BeagleBone specific.

author: nali
author_rank: Frequent Contributor
timestamp: July 20, 2019, 11:23:08 am
content: Quote from: MosherIV on July 19, 2019, 11:06:23 pmNot used BBB in a while, but from memory I think they are in /sys/class/gpio somewhere. There should be a direction and a value and you can just read or write to them e.g. using cat or echo.

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 20, 2019, 11:41:31 am
content: Quote from: nali on July 20, 2019, 11:23:08 amThe sysfs interface is deprecated. It's not going away, but all new userspace applications should use the character device interface instead; all new goodies will be added to that. If the hardware supports it, you can even get stuff like state change interrupts, without polling. Useful.
Looking for examples of Custom/Bulk USB class for i.MXRT10xx processors - Page 1
Forum section: electronics / general

author: cgroen
author_rank: Unknown
timestamp: May 27, 2019, 03:34:59 pm
content: Hello all,I'm working with the RT105x and RT106x processors from NXP and I am looking for USB bulk/custom driver. There are a lot of examples from NXP for CDC, printers etc, but none for Bulk/Custom USB class.I know its a long shot, but are there any of you that has done something similar for the RT processors ?

author: mark03
author_rank: Frequent Contributor
timestamp: June 27, 2019, 08:36:01 pm
content: In theory, I think this belongs in the "Microcontrollers" section. (Don't ask me why, but apparently bare-metal MCU stuff goes there while single-board computers and embedded Linux stuff goes here. Or something like that.)Anyway, my ulterior motive for replying is that I'd be very interested in the same thing

author: cgroen
author_rank: Unknown
timestamp: June 28, 2019, 07:28:07 am
content: You might be right mark about the section, but I don't think I'm able to move it myselfAnyway, have you had any luck/been brave enough, to look into a custom class for the RT series yourself ?I did spend quite some hours on it, but I got buried in the USB code, got no success, and finally gave up due to workload (needed to get the rest of the system running so had no time to do NXPs job)Its a pity considering all the other samples they have in their SDK that they couldn't have done just a simple custom bulk class

author: mark03
author_rank: Frequent Contributor
timestamp: June 28, 2019, 03:21:31 pm
content: I'm afraid not. I don't even have an IMX RT kit, just contemplating it for an upcoming project. My usual platform is STM32 and I would never dream of using ST's drivers except under duress. OTOH I am not familiar enough with USB to write my own, so the existence of simple and sane projects like libusb (https://github.com/dmitrystu/libusb_stm32) is a huge help. I was hoping something similar might exist in NXP-land.I guess the USB peripheral in the RT processors is the same as in their other iMX application processors? Is it shared by any other microcontrollers or is this its debut? I wonder if IMX Linux drivers would be any help?

author: Geoff_S
author_rank: Regular Contributor
timestamp: June 29, 2019, 04:05:34 am
content: I’ve developed custom USB classes for Kinetis micros using the NXP middleware. It wasn’t a lot of fun but I did get it working. Not sure if the RT chips use a similar library or not but I have an RT1020 dev board on its way so in a few weeks I will see.

author: cgroen
author_rank: Unknown
timestamp: June 29, 2019, 09:18:19 am
content: Geoff,sounds good! If you at some point can share something, it would be great!I also have a 1020 board coming from NXP survey. Already have the 1050,1060 and 1064 EVKs, great value !
Monitoring ESP32 power usage. - Page 1
Forum section: electronics / general

author: hamster_nz
author_rank: Super Contributor
timestamp: June 04, 2019, 12:14:27 pm
content: I've been monitoring the power usage of an ESP32+Camera module, while serving images over WiFi, and thought others might find this image interesting:You can see the module move through various states during startup, and see the power usage during serving an image at about 31 seconds, the "WiFi on" current is about 161mA.

author: thm_w
author_rank: Super Contributor
timestamp: June 04, 2019, 09:29:18 pm
content: 3.3V right. Are you using the example arduino code for the camera?Would last about 15hrs on an 18650 cell, not too much. But totally acceptable for using a low power 5V or so USB supply and leaving it plugged into the wall (~50c per year).If you wanted to get crazy, could possibly shut down WiFi based on motion detection.

author: Electro Fan
author_rank: Super Contributor
timestamp: June 11, 2019, 08:04:26 am
content: Quote from: hamster_nz on June 04, 2019, 12:14:27 pmHi, What instrument and software did you use to make and plot the measurements? Thx

author: hamster_nz
author_rank: Super Contributor
timestamp: June 11, 2019, 08:26:56 am
content: It is a home brew thing:- An ESP-32 Module- A 1 ohm 5W resistor as a shunt- 24 bit SPI differential ADC, sampling at 60S/s (but could go as high as 4.8kS/s)- A low noise 2.5V references.The ESP32 reads the samples from the ADC, scales it to uV (which is also uA), and outputs to the serial port.From there it is cut and past into Google Sheets to graph the values.Low tech, but quite functional.

author: imagiko
author_rank: Newbie
timestamp: June 16, 2019, 11:16:02 pm
content: Why do you need differential ADC module?Is the device "always on"? Assume the spike is when the camera is in action? are you trying to optimize for power ?

author: hamster_nz
author_rank: Super Contributor
timestamp: June 17, 2019, 12:22:32 am
content: Quote from: imagiko on June 16, 2019, 11:16:02 pm1. I am using a differential ADC because I had one handy.2. No, the device under test comes and goes depending on what I want to test.3. Yes, spike at about 30s was module serving a picture.4. ESP32 Wifi cams are not good as battery powered solution, unless they spend a lot of time in deep sleep (e.g. as a weather webcam uploading to a web sevice). WiFi uses quite a bit of power.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 18, 2019, 02:17:34 pm
content: Using a differential ADC to measure voltage across an high-side shunt seems reasonable to me.Would probably be handy to have higher sample rate (maybe something around an AD7764 or the like), but that's an useful tool nonetheless.
ST10F Familly Reading and programming - Page 1
Forum section: electronics / general

author: Jawad
author_rank: Contributor
timestamp: July 17, 2019, 11:38:23 am
content: I have been struglling for the past few weeks with some ST10F familly microcontrollers (ST10F271, ST10F267) but I can't seem to be able to connect to it. I used different softwares and hardware, I used st10Flasher with a USB to TTL and also with KKL interface but none of them seem to connect, it always complains about getting the wrong acknowlegment 0x6E instead of 0x5A but I think this is a generic error since it gives it even when connected to other wrong pins.the micro is already in BSL mode i'm sure of that.also tried hooking the the clock pins to an analyser to figure out the baud rate but they are always low (pin 80 and also tried pin 81)I wasn't able to find any dedicated In circuit programmer for this family of microcontrollers, also wasn't able to find the datasheet for ST10F267 but i think the pinout is the same for similar members of the famillyIf there is someone experienced with ST10F familly and was able to read and write to them successfully please tell me which Software/Hardware you used.I also thought about building my own arduino reader and programmer but since I've never done this and didn't find any hint online I was stuck at point 0any help will be appreciated
Problem reading Ps2 keyboard arduino  - Page 1
Forum section: electronics / general

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: March 06, 2019, 04:24:04 am
content: 1. I am using arduino mega, and arduino 1.8.8. Code is compied using O3 optimization. I have changes Os to O3 in platform.txt at 3 places for fast code.2. I have foloowing features enabled in arduino:a) code send data serial through usb port available on mega i.e. Serial0 at 9600 baud rate and also used to burn code via arduino softwareb) code reads data serially through a device, only rx pin is used, tx not connected. Serial2 at 2400 baud ratec) Lcd 20x4. : standard arduino libraryd) I2C based rtc ds1307 :https://github.com/PaulStoffregen/DS1307RTCe) Internal eeprom to read & store dataf) serial port used to trasmit data , only tx is used, rx unconnected. Serial3 at 9600 baud.g) Timer 3 at period interrupt of 20ms to scan 4 keys connected at pins.h) A ps2 keyboard :https://www.pjrc.com/teensy/td_libs_PS2Keyboard.html3. Problem is when i start the code, i read nothing from PS2 keyboard even if I press the keys on ps2 keyboard. If I keep on pressing some ps2 keyboard for around 10sec, then keyboard start working fine.4. If i disable everything in code except ps2 library, then code works fine.5. in complete code, i dont see anywhere i disable keyboard lib.6. what i suspect, is that i have too many serial interrupt on rx pin, that may be causing issue, as it may interrupt the ps2 code. I dont read serial interrupt actually, as I read on sequentially in mainloop code. where to disable serial interrupt?7. if not, what else could be issue

author: JustMeHere
author_rank: Frequent Contributor
timestamp: March 06, 2019, 04:39:38 am
content: Not sure how to help, but I'm fairly each key press produces two events. A key down and a key up. You might be seeing something related to that.

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: March 07, 2019, 04:49:54 am
content: I realised, it works fine in below case:1. When i power up system, without connecting PS2 keyboard, and then connect PS2 keyboard i,e after power up, then it works, all three led on keyboard blinks and it works fine.2. Whereas when i power up the system with ps2 keyboard connceted, then keyboard dont work. If then i keep pressing some key, after sometime all three led blink & then keyboard works. But i have to press key for more than 15-20sec

author: GromBeestje
author_rank: Frequent Contributor
timestamp: June 14, 2019, 09:29:46 am
content: When do you initialise the PS/2 interface? Are there pull-up resistors on the PS/2 lines? Is there a chance the microcontroller pulls the clock line low? (Putting the keyboard into "communication inhibited" mode)Also, on what voltage are you running? Be aware the PS/2 interface is a 5 Volt interface. Running it 3v3 might cause an issue that a "high" is misinterpreted as a "low". Furthermore, saying it starts working after 20 sec, might there be a large capacitor charging up on the supply for the keyboard or its pull up resistors?
Using avrdude to program USB interface on Arduino Uno R3 - Page 1
Forum section: electronics / general

author: CambridgeMart
author_rank: Regular Contributor
timestamp: May 19, 2019, 01:44:46 am
content: I'm tring to program the ATMega 16U2 device on an Uno R3 with the MIDI USB firmware; I'm using avrdude to program the 16U2 via the ICSP header using an Arduino Nano configured as an ISP device. Avrdude is throwing errors indicating it can't sync with the target, but I'm not sure where I'm going wrong. The command I'm using is:avrdude -p at90usb162 -F -P COM7 -c avrisp -U flash:w:dualMoco.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:mCOM7 is the virtual port that my arduino ISP appears as; I'm using at90usb162 to identify the 16U2, based on my research this appears to be the correct target.The error is avrdude: stk500_getsync(): not in sync: resp=0x00Any suggestions please?

author: Psi
author_rank: Super Contributor
timestamp: May 19, 2019, 01:52:21 am
content: Is the Arduino Nano frequency correct? 8mhz and 16mhz versions exist.If there's a mismatch you will have these sort of issues.Also check your nano has correct reset line and ground connections to target 16u2 device.

author: oPossum
author_rank: Super Contributor
timestamp: May 19, 2019, 06:50:44 am
content: You may have to disable reset on the nano to prevent it from entering the booloader when COM7 is opened.
arduino PCB debugging and programming - Page 1
Forum section: electronics / general

author: OM222O
author_rank: Frequent Contributor
timestamp: May 06, 2019, 02:40:49 am
content: For a project I've designed a PCB using the atmega-328p chip. I have exposed probe points on the PCB so I can test for shorts , voltage levels etc using a jig and another atmega328-p on a jig.I also know that the atmega328-p can be programmed to act as a programmer itself and if I can use one chip to both program the MCU in circuit AND do the debugging it would be a lot faster and more convenient than what I'm doing right now: using a QFP to DIP socket, programming the chips one by one and then soldering them on the final product. I'm just not sure if altering the code of the "Arduino as ISP" which makes it able to burn boot loader and program another chip, will cause some sort of errors ... I suppose I can have 2 jigs: one for programming and one for debugging but it would be great if I can just use one to speed up the process.If you know how the "Arduino as ISP" sketch works or if I can modify it without breaking it, please let me know. I tried going through the code but it's very long and I'm not really sure what a lot of the lines do.

author: sleemanj
author_rank: Super Contributor
timestamp: May 06, 2019, 07:38:12 am
content: The ISP protocol is defined byAVR910, in consultation with the datasheet of course.Long ago I wrote an Arduino library to program other AVR chips over ISP, I never really cleaned it up but it should still work, I've pushed it to github and you can see a couple of untested off-the-cuff examples of usage in the READMEhttps://github.com/sleemanj/ArduinoProgrammer

author: OM222O
author_rank: Frequent Contributor
timestamp: May 06, 2019, 12:59:45 pm
content: I'm using the ISP code that is provided by the arduino IDE itself. I was just wondering if changing the code to do other things will interfere with that code as I don't really understand what the ISP code does.

author: OM222O
author_rank: Frequent Contributor
timestamp: May 06, 2019, 05:34:21 pm
content: Also another thing that I'm worried about is when setting nets to +5V, there might be chance to apply a reverse voltage on some of the capacitors. I have never had one blow up before, but is it something I should be worried about? for example if a net is shorted to ground, it will pull ground to +5v (since the circuit itself is not powered on) and the 5v line is floating (could be floating at 0v), it can put -5v on the input bypass capacitor and I know that anything more than -1v on a polar capacitor will damage it
ESP8266 / 8285 / 32 ARP issues with work around. - Page 1
Forum section: electronics / general

author: paulca
author_rank: Super Contributor
timestamp: August 17, 2019, 06:25:41 pm
content: Been having an issue with my SOnOff switches. Basically ESP8266 or ESP8285 chips.The issue is that while they will happily contact any host on the LAN, they are incredibly hard to get a hold off the other way around, contacting them.This came down to ARP caches. The ESP seems not to respond to ARP requests, or it's ARP responses are not forwarded by various access points.An example replication of this issue is as follows, an ESP8285 is available on 10.0.0.7 and I am on "everest".Flush the ARP entry if there is one:Code:su -c "arp -d 10.0.0.7"Code:paul@everest ~ $ ping 10.0.0.7PING 10.0.0.7 (10.0.0.7) 56(84) bytes of data.From 10.0.0.199 icmp_seq=1 Destination Host UnreachableResulting in:Code:20:23:59.764113 ARP, Request who-has 10.0.0.7 tell everest, length 2820:24:00.804257 ARP, Request who-has 10.0.0.7 tell everest, length 2820:24:01.844115 ARP, Request who-has 10.0.0.7 tell everest, length 2820:24:02.884099 ARP, Request who-has 10.0.0.7 tell everest, length 28The ESP does not respond to ARP broadcasts for it's MAC. It's dead Jim!However, if .. and this is a bit weird... if you get it to pingitself, this happens:Code:20:24:48.136621 ARP, Request who-has 10.0.0.7 tell 10.0.0.7, length 4620:24:49.138602 ARP, Request who-has 10.0.0.7 tell 10.0.0.7, length 4620:24:50.135752 ARP, Request who-has 10.0.0.7 tell 10.0.0.7, length 46And eventually this:Code:20:26:53.447901 ARP, Reply 10.0.0.7 is-at dc:4f:22:a8:0b:cb (oui Unknown), length 46For some reason, getting the device to ping itself seems to wake up it's ARP subsystem and it's MAC is discoverable again. Without doing this I can't even find the ESP on the LAN using nmap scans!
Arduino IDE or Atmel library for SPI NoR flash memory with SAML21 compatibility  - Page 1
Forum section: electronics / general

author: madhu.wesly01
author_rank: Regular Contributor
timestamp: March 22, 2019, 06:51:21 am
content: Hi everyone,I am looking for an Arduino IDE or Atmel-studio library for SPI NoR flash memory with SAML21 compatibility. Please let me know if I can get it anywhere.Thank you
Parallel Arduino 4x4 keypad. - Page 1
Forum section: electronics / general

author: IY3775
author_rank: Newbie
timestamp: March 13, 2019, 04:11:28 pm
content: Hey! Will this configuration work properly?4x4 keypad, has 4 rows and 4 columns, total 8 pins.The keypad pins from 2 to 8 will be connected to an Arduino Mega 2560 digital pins 2 to 8, and keypad column 1, row pins 5, 6, 7, 8 will be connected to an Arduino Uno/ Nano digital pins 2 to 6. (This leaves ABCD keys from Mega and connects them to the Uno).Both will have a sketch that uses 'keypad' library. (Searches for keypress in the matrix).My question is, will it cause any problems with some keypad pins as mentioned above are connected to both Arduinos?Sent from my Mi A1 using Tapatalk

author: jlmoon
author_rank: Unknown
timestamp: March 14, 2019, 05:21:06 am
content: I believe without using any style of gating, you're going to have output/input pin contention. If the two processors have different bus voltages ie. 3.3 / 5 V you're going to damage the devices. This keyboard is designed as a matrix array, generally during your keyscan program you set a column or row at a constant level and then scan the rows for a equivalent level. Then you repeat using another column and row scan again until you have gone through the entire 16 combinations. If your going to multiplex that keyboard, you will need to gate the multiplexed lines through a configuration of addressable multiplexers, and with timing considered enable one set of columns and rows and look for keys, then switch multiplexers to the other processor. Probably going to require a interrupt scheme to keep everybody happy. In summary, in native form it will be quite difficult to tie two platforms to one keyboard.

author: IY3775
author_rank: Newbie
timestamp: March 14, 2019, 05:28:03 am
content: Quote from: jlmoon on March 14, 2019, 05:21:06 amBoth will have 5V at the digital pin.Sent from my Mi A1 using Tapatalk

author: viperidae
author_rank: Frequent Contributor
timestamp: March 14, 2019, 09:20:37 am
content: You will still need a method to stop both micros driving different columns at the same time. If they do you'll get the wrong keys detected.

author: tooki
author_rank: Super Contributor
timestamp: March 14, 2019, 02:43:56 pm
content: I think it’d be wiser to have the Arduino Mega run the keypad, and then send commands to the Uno via serial or I2C or whatever.