hybridfree/eevblog-posts huggingface dataset:
XRA1403 SPI GPIO Expander Interrupts - Page 1
Forum section: electronics / general

author: kevinateev
author_rank: Regular Contributor
timestamp: February 27, 2022, 02:19:13 pm
content: Has anybody ever managed to get the Interrupt working on this chip,https://www.maxlinear.com/product/interface/bridges/gpio-expanders/spi-gpio-expanders/xra1403I send the following codes to it but I get no interrupt on PIN 1.WRITE GCR (06) 0x00 -- P0-7 outputWRITE GCR (07) 0xFF -- P8-15 inputREAD GSR (81) 0xFF -- read pin status and clear interrupts P8-15WRITE IER (0B) 0xFF -- write interrupt enable P8-15WRITE REIR (11) 0xFF -- rising edge interrupt P8-15I've got P8 at normally low and am pulling it high with a button.And yet, my pin 1 does not go low. I have a pullup set on the microcontroller side.

author: kevinateev
author_rank: Regular Contributor
timestamp: February 28, 2022, 01:42:24 pm
content: I've uploaded the project where I'm stuck with this issue ... interrupts not working.https://github.com/kpishere/pico_experimentsIt is the hello_spi project.FYI: This repo also shows a convenient workflow with RP2040/Pico, J-Link, openocd, and gdb

author: kevinateev
author_rank: Regular Contributor
timestamp: March 02, 2022, 07:04:54 pm
content: Also, found this really interesting paper that does a market survey of this class of chip. Focuses on the I2C communication type, not SPI but still, here are some alternate part numbers.https://neo900.org/stuff/papers/iox.pdf

author: kevinateev
author_rank: Regular Contributor
timestamp: March 03, 2022, 01:44:14 pm
content: OK! Problem solved!The working code is in the repo already linked above. The datasheet was very terse for this chip, there is ONLY a linux driver out there but that is almost un-readable due to driver abstractions in linux. Here was the essence of the hangup with the datasheet:1) The datasheet didn't indicate that you MUST have CS line go high between command/data messages (16bits)2) The command representation is a bit odd. If you are showing a hexdecimal number for each command, why not show in the actual 8bit format? Why shift the values all to the right one bit?I'd found it easier to represent the bytes as follows below as these are values I can cross reference on logic analyzer without having to bit shift in my head. From the below values, I add 0x02 to indicate the second bank when needed./* XRA registers */#define XRA_GSR 0x00 /* GPIO State - Read-Only */#define XRA_OCR 0x04 /* Output Control - Read/Write */#define XRA_PIR 0x08 /* Input Polarity Inversion - Read/Write */#define XRA_GCR 0x0C /* GPIO Configuration - Read/Write */#define XRA_PUR 0x10 /* Input Internal Pull-up Resistor Enable/Disable - Read/Write */#define XRA_IER 0x14 /* Input Interrupt Enable - Read/Write */#define XRA_TSCR 0x18 /* Output Three-State Control - Read/Write */#define XRA_ISR 0x1C /* Input Interrupt Status - Read-Only */#define XRA_REIR 0x20 /* Input Rising Edge Interrupt Enable - Read/Write */#define XRA_FEIR 0x24 /* Input Falling Edge Interrupt Enable - Read/Write */#define XRA_IFR 0x28 /* Input Filter Enable/Disable - Read/Write */
ESP32 hardware and software stability - can I trust it for control applications? - Page 1
Forum section: electronics / general

author: Miyuki
author_rank: Frequent Contributor
timestamp: February 23, 2022, 08:08:38 am
content: Hi folks.I wanna ask about your experience with long-term running ESP32.I know many IoT devices and ESPHome have not just a main watchdog but also a reboot when the wifi did not connect, as the wifi stack used to be considered unstable in long uptime (days, weeks).I'm considering using it in places where I cannot afford to reboot. No sleep mode or any power saving features will be used, and devices will ping each other every second or so.What is your experience? Is this just an unfounded fear and I can rely on them?//edit: Also considering using TI CC3200 as an alternative from "better" manufacturer

author: Swake
author_rank: Frequent Contributor
timestamp: February 25, 2022, 05:32:00 pm
content: You'll have to give more details about your application.If you cannot afford to reboot you might have to add some form or another of redundancy. What happens if a component fails (the mcu or something else)?

author: PlainName
author_rank: Super Contributor
timestamp: February 26, 2022, 03:06:02 pm
content: QuoteI've had this during development. The problem seems to be the RF calibration causes poor or non-existent connection and nothing in the stack can fix that. The solution is to reboot which causes the calibration to be redone/updated. I think the hardware frontend can be dodgy on some devices - the symptoms for ones that I know are poorly assembled look the same, so devices that mostly work might just be slightly better assembled ones.

author: Miyuki
author_rank: Frequent Contributor
timestamp: February 26, 2022, 04:40:56 pm
content: Quote from: Swake on February 25, 2022, 05:32:00 pmIt is sports time measuring equipment. Measuring down to 10ms time step.Current and higher-priced units run on Atmel XMEGA with cable or old analog radio connection to sensors. This has run fine for years.So if to won't start and work and is just dead. It is OK. But it should not start and then go crazy.As currently is in the developed WiFI data transfer to PC. For cheaper units, it is considered to run as a single-chip solution with all connections over WiFi.
PIC10F204 with MPLAB X Can't even get a TRIS to work - Page 1
Forum section: electronics / general

author: drvtech
author_rank: Regular Contributor
timestamp: February 25, 2022, 12:26:36 am
content: I want to use a PIC10F204 to do a very simple job. I've chosen that chip because some actually exist, unlike a lot of other small MCUs, and because I have a handful of samples to get going on.I've got MPLAB X IDE installed and have used it a little before. I thought I would check the whole lot was working by writing a program which simply sets the configuration bits, sets the TRISGPIO register for all outputs and toggles some bits.I can't even get the TRISGPIO = 0x00; to work - the pins all stay as high impedance. The only instruction I can get to work is OSCCAL = 1; which I did just to prove that the code I was executing was what I thought I was compiling!This is the code I triedCode:void main(void){OSCCAL = 1;TRISGPIO = 0b0000;while(1){GPIO = 0x00;GPIO = 0x01;GPIO = 0x00;GPIO = 0x01;GPIO = 0x00;GPIO = 0x01;OSCCAL = 0;}}and this is configuration_bits.cCode:#pragma config WDTE = OFF // Watchdog Timer (WDT disabled)#pragma config CP = OFF // Code Protect (Code protection off)#pragma config MCLRE = ON // Master Clear Enable (GP3/MCLR pin function is MCLR)I've got a scope probe on pin 3 (GP2/T0CKI/COUT/FOSC4) and when I pulse \MCLR I can see a burst of 11 clock pulses, which seems about right for 6 lines of code, but another probe on pin 5 (GP0/ICSPDAT/CIN+) stays stubbornly high impedance. I've been staring at this all evening and can't see what on earth I'm doing wrong. I checked the listing file and that looks correct. What on earth can I be doing wrong?

author: Andy Watson
author_rank: Super Contributor
timestamp: February 25, 2022, 12:57:31 am
content: GP0 (and GP1) are shared with the analogue inputs to the comparator. Usually, an analogue input will take precedence over digital I/O, i.e. you need to turn-off the comparator as part of the initialisation.

author: drvtech
author_rank: Regular Contributor
timestamp: February 25, 2022, 01:24:48 am
content: Oh you complete star. Yes, that works perfectly now. Thank you so much.Dave
ST visual develop keep crashing - Page 1
Forum section: electronics / general

author: old gregg
author_rank: Regular Contributor
timestamp: June 02, 2018, 04:23:31 pm
content: I wanted to try out the STM8 serie, I installed the st sofware "ST visual develop" on Win7 but the thing keep crashing everytime I hit "tools/programer" to program the microcontroller.Is anyone having the same issue ?

author: funkathustra
author_rank: Regular Contributor
timestamp: June 03, 2018, 06:16:46 am
content: Why are you on such an old operating system?I've ran STVD on several Windows 10 computers without any issues (other than it being, you know... STVD).

author: old gregg
author_rank: Regular Contributor
timestamp: June 03, 2018, 01:45:41 pm
content: Quotebecause it still works, I don't want to change and I haven't won at the lottery yet...I found out the answer though :https://community.st.com/thread/45768-st-visual-developer-says-out-of-memory-and-crashes-when-trying-to-launch-the-programming-toolapparently the installer comes with a file that makes the thing crash(on Win7 anyway).I change the file for the one given in this thread. Seems to have fixed the problem.

author: xjordanx
author_rank: Contributor
timestamp: February 22, 2022, 01:26:00 am
content: I also have this problem, but I'm on Windows 11.This time, it's not the same error as "Out of Memory" which is discussed on the ST forums.This gives NO WARNING and NO ERROR MESSAGE. It just completely gets killed.ST Visual Programmer does work as a standalone program, which is interesting.I did also try updating the firmware on the ST-LINK V2 I have to the latest. Still a problem.ST Link-V2 shows up correctly in Device Manager.Any other ideas? Anyone else seen this and found the workaround?For a company that sells literally BILLIONS of STM8s, I would think they'd be much better at supporting and updating and maintaining these tools which are somewhat horribly archaic...

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 22, 2022, 10:59:20 am
content: Maybe try older versions? Found few over internet, uploaded them here:https://mega.nz/fm/fmIQhbjK

author: xjordanx
author_rank: Contributor
timestamp: February 22, 2022, 05:22:06 pm
content: I solved this problem by completely wiping and then reinstalling the software all to a non "Program Files" path, with path permissions set to be more relaxed (Windows XP style) and then making sure all my environment variables were set for the new path in C:\DevTools\... etc.Just a breadcrumb for those who may follow.
PIC16F687 auction 3000 pcs - Page 1
Forum section: electronics / general

author: Circlotron
author_rank: Super Contributor
timestamp: February 18, 2022, 11:26:39 am
content: No bids so far.Minimum bid $1Ends: Sunday 20/02/2022 7:00pm AEDThttps://www.pickles.com.au/general/item/-/details/PIC-Series-Micro-Controller-IC-MCU-8Bit-3-5KB-Flash-20DIP--Quantity-3000/1020132336

author: Helix70
author_rank: Unknown
timestamp: February 18, 2022, 01:04:06 pm
content: If I win, will someone collect it for me? I will split it with you

author: rpiloverbd
author_rank: Regular Contributor
timestamp: February 19, 2022, 10:51:46 am
content: All chips functioning well?

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 19, 2022, 11:53:11 pm
content: Quote from: rpiloverbd on February 19, 2022, 10:51:46 amNice trolling, I'd buy them only if you test all the 3000

author: leftek
author_rank: Regular Contributor
timestamp: February 21, 2022, 11:30:43 am
content: Quote from: DavidAlfa on February 19, 2022, 11:53:11 pmWhere is the joke?

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 21, 2022, 01:40:18 pm
content: Because:Who auctions 3000 damaged chips? The question doesn't make sense.But if you're the seller and get asked, you could only confirm that if they're new.It's a pretty old chip, could have been stored for 15 years anywhere.In that case, how to you know if the 3000 chips are working unless you test them all?That's why I laughted at "All chips functioning well?”

author: Circlotron
author_rank: Super Contributor
timestamp: February 21, 2022, 08:48:27 pm
content: Did anyone here win the auction?
Nvem v2 (ethernet cnc controller) - Page 1
Forum section: electronics / general

author: Jmh474
author_rank: Newbie
timestamp: February 19, 2022, 08:00:15 am
content: So I'm not overly happy, I brought a cnc controller for a project, as you can probably guess I'm building a cnc router.I brought the akz250 I hope it was going to be a decent controller (£60), but it all started when asked for a .bin file when connected to mach3, after talking to the seller for 2 weeks they finaly provide me with the .bin file and some instructions to follow.So I followed the instructions and uploaded the .bin file and now iv lost all communication with the controller, when checking the status of the connection the computer is sending packets but not receiving anything, iv doubled checked the setup and everything seems to be fine.I'm guessing this is not a hardware issue but a programing/firmware related issue.As you can guess I'm not getting any response from the seller now and its been over 3 months.I'm just wondering if anyone has any ideas on what I could try to get it working again or even a way to use it even.Thanks for any help or advice
Difference ATMEGA32U2-AUR vs ATMEGA32U2-AU ? - Page 1
Forum section: electronics / general

author: M_a-r_k-u_s
author_rank: Newbie
timestamp: February 18, 2022, 09:13:18 pm
content: What is the difference between ATMEGA32U2-AURand ATMEGA32U2-AU? I was not able to find it yet.Thanks,Markus

author: eugene
author_rank: Frequent Contributor
timestamp: February 18, 2022, 09:25:20 pm
content: The AUR is tape and reel whereas the AU comes in a tube. If you're soldring by hand it doesn't matter. If someone with pick-n-place is doing it then they would likely prefer the tape and reel.

author: ataradov
author_rank: Super Contributor
timestamp: February 18, 2022, 09:25:28 pm
content: "R" is tape and reel no-"R" is tray packaging. No functional differences.This is TQFP package, so it is not a tube, but a tray. And PnP machines can deal with them too, although not as easily.

author: M_a-r_k-u_s
author_rank: Newbie
timestamp: February 18, 2022, 10:58:12 pm
content: Thanks, this helps me very much.
Arduino IDE 2.0 Release Candidate - Page 1
Forum section: electronics / general

author: rstofer
author_rank: Super Contributor
timestamp: February 03, 2022, 04:17:30 pm
content: Here a video from DroneBotWorkshop re: the new IDE 2.0

author: newbrain
author_rank: Super Contributor
timestamp: February 03, 2022, 11:21:17 pm
content: VS Code begat Eclipse Theia, and Theia begat Arduino IDE 2.0.I'll definitely take that over the old one (calling that pitiful thing "IDE" was really stretching it)*.I'm not too familiar with Theia, I hope the Eclipse Foundation will not make it as bloated and hideous as Eclipse.* Rather, I would take it if I used Arduino (though probably I'd stay on VS Code + some extension).

author: Tarkus
author_rank: Newbie
timestamp: February 09, 2022, 07:20:03 pm
content: I've played around with it a bit. It certainly seems a bit more fleshed out but it still doesn't behave like a modern IDE aside from having panels along the sides and bottom of the edit area. It's better than the old IDE but I would call it maybe adequate at best.

author: rpiloverbd
author_rank: Regular Contributor
timestamp: February 18, 2022, 09:55:10 am
content: Hope it is absolutely bug free.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 18, 2022, 05:53:46 pm
content: Quote from: rpiloverbd on February 18, 2022, 09:55:10 amYou can count on that.

author: janoc
author_rank: Super Contributor
timestamp: February 18, 2022, 07:11:32 pm
content: Quote from: Tarkus on February 09, 2022, 07:20:03 pmDifferent target audience - they are making it like that intentionally because it is targeting beginners and education market. There all those extra features are a distraction. That's why the old "IDE" is still so popular and widely used, despite its limitations.More serious developers have likely switched to PlatformIO or directly VSCode since a long time ago.
Mikroe Easypic PRO V7 development board issues - Page 1
Forum section: electronics / general

author: leftek
author_rank: Regular Contributor
timestamp: September 18, 2021, 05:02:21 am
content: Hello,i have one Mikroe Easypic PRO V7 development board and i have some issues with it.I have observe some problems that make me to lose my trust and continue on it.- some led's that not work- some buttons that don't contact smooth- sometimes after restart don't have stable running and i re-programming itThe question is if someone has general problems with these boards. Problems that make yourself to doubt about stable of it.

author: hexreader
author_rank: Frequent Contributor
timestamp: September 18, 2021, 10:00:55 am
content: I have many MikroE development boards, and have NEVER had a single LED fail on any board.Run the "LED curtain" example program with the supplied PIC18F87K22 PIM. All but 3 LEDs will flash (and 3 more LEDs that are not fitted)LEDs for RG6, RG7, RF0 will not light - this is normal.I have had buttons that are intermittent on older v6 boards, but not EasyPIC pro v7, which I have owned for many years and still works perfectly.Test switches (and the 3 remaining LEDs) by setting all button press levels to Vcc, turning on all LEDs, hold down reset with one finger, press each button in turn with finger from other hand.Should you find an intermittent button, press it hard many times and it may come back to life..... Unless you are talking about button bounce, which is normal and requires software debounce techniques.

author: leftek
author_rank: Regular Contributor
timestamp: September 18, 2021, 02:25:19 pm
content: Quote from: hexreader on September 18, 2021, 10:00:55 amYes you are right. The mistake was mine. I have adding in code delay 500ms after the pressing of button and it's ok now.Thank you.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: February 11, 2022, 06:45:34 am
content: I have this board too and have had no problems with it whatsoever. It’s been very stable and solid.With regards to LEDs not lighting, are you sure the ports you’re driving them with aren’t in analog mode? That’s the default for some GPIO ports and you have to clear bits in the ANSELx register to make those ports digital outputs.I have not seen the instability issues after a reset that you have. Are you using one of the MikroE tools or MPLABX? Are you using the built-in debug hardware or a PICkit or ICD3/4?

author: leftek
author_rank: Regular Contributor
timestamp: February 12, 2022, 04:01:52 pm
content: I had use that with MikroE and built-in programmer.I don't know where is the problem.

author: rpiloverbd
author_rank: Regular Contributor
timestamp: February 18, 2022, 09:51:21 am
content: Hi, have you contacted microelectronika regarding the problem?

author: leftek
author_rank: Regular Contributor
timestamp: February 18, 2022, 01:36:57 pm
content: Hello, no i have't yet, but i must to record it and send to him.
SPI on SAMD21G18 not working - Page 1
Forum section: electronics / general

author: malrip
author_rank: Newbie
timestamp: February 16, 2022, 05:02:07 pm
content: Hello,I've been attempting to use SERCOM2 SPI Master on the SAMD21G18J but have been unsuccessful. I tried the configurations with SERCOM0 and SERCOM4, and they both worked. The most intriguing behavior is that when I initialize the SERCOM2 SPI, all of the other I/O pins stop working as well. The clock is not generated, and CS is not operational.I tried several bootloaders, but the results were the same. To begin, I used the bootloader of an Arduino nano IOT 33, which uses the same chip, in order to use the arduino IDE more easily. Then, I tested with the bootloaders Arduino zero and adafruit M0 bootloader. The idea of testing other bootloarders was because arduino ano iot 33 uses SPI SERCOM2 to communicate with his WIFI module, and could be protected some how. Any insight will be useful.The schematic is displayed below:https://community.atmel.com/sites/default/files/forum-images/462842-body-1645030566-1.jpgThe SERCOM2 Pads:https://aws1.discourse-cdn.com/arduino/original/4X/7/3/9/73938e5c4bae0c9fbcc55e3ba7afc86408f0e02b.pngMain routine:https://www.codepile.net/pile/y6bB1d6wHeader file:https://www.codepile.net/pile/l56XN6x3

author: snarkysparky
author_rank: Frequent Contributor
timestamp: February 16, 2022, 07:35:23 pm
content: I look at it quickly so I may have missed something.I see you setup the slave select. But you also have to setup the other pins. Is that somewhere else ?

author: malrip
author_rank: Newbie
timestamp: February 16, 2022, 10:47:34 pm
content: No problem. I have set to master at line 41: SERCOM2->SPI.CTRLA.bit.MODE = 0x3; //SPI in Master modeThe other pins are set on lines 38, and 39, DIPO and DOPO registers.

author: thm_w
author_rank: Super Contributor
timestamp: February 17, 2022, 12:58:36 am
content: atmel link:https://www.avrfreaks.net/forum/spi-samd21g18-not-workingI'm sure this is unrelated, but, why is pin 18 not connected to Gnd?Can you try without a bootloader, do you have a proper programmer? But then you'd have to set up clocks, etc.

author: malrip
author_rank: Newbie
timestamp: February 17, 2022, 11:13:58 am
content: Oh, I forgot about this pin. If SERCOM2 requires this pin to function, it would be a strange coincidence. I'll solder this pin to ground and see what happens. Yes, I burned the bootloader using Segger J-link and Atmel Studio.
Problems with data transmission over the serial port - Page 1
Forum section: electronics / general

author: Remark
author_rank: Contributor
timestamp: February 10, 2022, 02:03:08 pm
content: Hello!I have several devices connected to the RS485 USB (CH340) converterhttps://static1.gleanntronics.ie/eng_il_RS485-CH340-USB-Converter-Modbus-Profibus-PLC-Arduino-71.jpgthe devices are connected on a garland basis from one to another.These devices should send a response to the master at a unique time interval to avoid data collisions. My master 'device' is python application running PySerial. When for example 1 digit is sent from master to slaves, they should respond back with their ID addresses. But the problem is, that I get only last device on the line response (with longest delay) and I don't get answers from all the other devices. If I disconnect that one device with longest response time, then responds other with the longest interval and so on...Maybe there are those who know what this could be too problematic? Is it possible for the master to receive a response from slaves after sending a request, for example: b '\ x1 \ x2 \ x3 ...' ?

author: Siwastaja
author_rank: Super Contributor
timestamp: February 10, 2022, 04:16:16 pm
content: There is this ongoing another thread about "intermittent problems". Yours is not intermittent, but the same applies:You need to add visibility to the system and investigate systematically.Some slaves do not respond. Possible causes:* They do respond, but master does not hear them* They actually do not respondLet's assume the latter... Why don't they respond?* They don't see the poll command* They do see it, but fail to reply correctlyYou see where this is leading? You need to know what part of your code is running. Simplest way: make the thing switch an IO pin to a different state when it receives the command. Look at the pin with an oscilloscope. You can also use UART printing, or a debugger, adding a breakpoint. Many different ways, but the troubleshooting strategy is important.

author: Renate
author_rank: Super Contributor
timestamp: February 16, 2022, 07:17:19 pm
content: My RS-485 (Modbus, actually) slave cards have two LEDs. One for any activity, one for personally selected.
installing raspberry pi library issue - Page 1
Forum section: electronics / general

author: nomar123
author_rank: Contributor
timestamp: February 11, 2022, 12:47:01 am
content: I am a raspberry pi noob so please forgive me if I sound like a novice here....I am trying to set up a optical fingerprint sensor with my raspberry pi. I am following these instructions here:https://tutorials-raspberrypi.com/how-to-use-raspberry-pi-fingerprint-sensor-authentication/I get to the part where I try to install the python-fingerprint library by using: apt-get install python-fingerprint --yesI am getting the following readback in my terminal:root@raspberrypi:/home/pi# apt-get install python-fingerprint --yesReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies:python-fingerprint : Depends: python:any (< 2.Depends: python:any (>= 2.7.5-5~)Depends: python-serial but it is not installableDepends: python-pil but it is not installableN: Ignoring file 'pm-codeworks.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extensionN: Ignoring file 'pm-codeworks.list.2' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extensionN: Ignoring file 'pm-codeworks.list.3' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extensionE: Unable to correct problems, you have held broken packages.So it seems as though the package has 4 dependencies that it needs me to instal first but is unalble. the article makes mention of this and says to run: apt-get -f installI did this but nothing really seemed to change.I run the following command to detect if the sensor is there:python2 /usr/share/doc/python-fingerprint/examples/example_index.pyBut it cannot find the file. I was assuming the first couple steps in the article was downloading all the files i needed, but i cant seem to find it.Any suggestions on what I am doing wrong?

author: retiredfeline
author_rank: Frequent Contributor
timestamp: February 11, 2022, 01:03:03 am
content: That looks like an old package that depends on python2 which has been deprecated.Perhaps it has been ported to python3 which might be called python3-fingerprint or something like that? Is this the one you were hoping to install?https://github.com/bastianraschke/pyfingerprintA search also shows that there are modules for fingerprinting documents, to add to the confusion.

author: rpiloverbd
author_rank: Regular Contributor
timestamp: February 16, 2022, 12:17:10 pm
content: If you're using adafruit fingerprint sensor, I think you'd better look here:https://learn.adafruit.com/adafruit-optical-fingerprint-sensor/circuitpython
MPLAB injection help - Page 1
Forum section: electronics / general

author: Tangent_Tracker
author_rank: Regular Contributor
timestamp: February 14, 2022, 05:11:56 pm
content: Hi folks, so I want to inject, on demand, 21 bits, 4uS each representing a clock burst into RA2, and simultaneously injecting 21 bits of data that changes on the clock low to high transition. Everything will finish with a high on the clock output and low on the data output.Struggling to work out how to do this...Can anyone please assist me?Thanks.
PIC16F1789.inc File Error - Page 1
Forum section: electronics / general

author: jpanhalt
author_rank: Super Contributor
timestamp: February 22, 2022, 01:00:32 pm
content: I am a MPLab 8.92 Assembly user and am converting code for a 16F1783 to a 16F1789. To my surprise, I get an error that "SSPCON1" is not found. However, the current and older data sheets refer to it: (attached)The .inc file in the corresponding MPASM Suite folder for that chip simply lacks that register's name.QuoteI know I can modify the file and add EQU H'0215', but I am reluctant to change gospel. Can anyone post a more current .inc for that device? The only reason for the chip switch is package and pins.Thanks, John

author: jpanhalt
author_rank: Super Contributor
timestamp: February 22, 2022, 02:21:43 pm
content: I thought I could edit/replace the .inc, but apparently a permission is needed. So, I just added this to my code:Code:;Header Files (edit)#define SSPCON1 SSP1CON ;error in .inc file omits SSPCON1It works.

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 22, 2022, 05:10:43 pm
content: SSPCON was for older devices having only one MSSP module.Then they added more (SSP1,SSP2, etc), renaming SSP to SSP1 even for devices with only one MSSP.That enhances code compatibility, avoiding the exact problem you're having right now.They still allowed legacy use of SSP naming, but it seems they missed that one in the header.Just replace SSP* with SSP1*:SSPCON -> SSP1CONSSPBUF -> SSP1BUFSame for bits:btfss PIR1, SSPIF -> btfss PIR1, SSP1IFBut if it's already working, why bother?

author: jpanhalt
author_rank: Super Contributor
timestamp: February 22, 2022, 05:55:49 pm
content: My concern was that in Microchip jargon, SSPxCONy, means x is the module number if more than one, and y denotes the register in that module, if more than one.Hence, 16F1783 has only one MSSP module, so SSPCON1, SSPCON2, and SSPCON3 would be minimally required in its .inc file; although, it also has SSP1CON, SSP1CON2, SSP1CON3 and even SSPCON for compatibility reasons probably.The 16F1789 also has only one MSSP module, and its .inc is identical to the SSP module for the 16F1783, except it does not include a definition for SSPCON1, which is the name of that register in the datasheet. (attached). I was a little surprised that I couldn't modify the manufacturer supplied user libraries as one can do with Eagle, but it was an easy fix.I later spent some time on Google looking for a report of that bug and found nothing. I did not search the Microchip forum, as it is more difficult to navigate.

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 22, 2022, 06:37:24 pm
content: You're not getting anything fixed by Microchip, MPLAB was deprecated a decade ago.
SPI flash (Winbond W25Q80BV) - beginner getting started (GCC/SPI) - read status? - Page 1
Forum section: electronics / general

author: wb0gaz
author_rank: Frequent Contributor
timestamp: February 13, 2022, 06:38:11 pm
content: I've attached a WINBOND W25Q80BV SPI flash device to my microcontroller project. The microcontroller has an SPI port. I'm not using double or quad SPI, just single-bit read/write, and I've pulled the HOLD and Write Protect pins to 3.3V. I've used SPI successfully in the past and given that some commands are working (see below), I believe the basic process of issuing (these specific) commands and getting a valid response are working.So far, I can successfully read Manufacturer/Device ID (command 90h), read Unique ID number (command 4Bh), read JEDEC ID (command 9Fh), and read SFDP register (command 5A). All of these produce expected responses.PROBLEM: My attempt to read status (command 05h) yields all zeroes in response (even if I set write enable using command 06h). Read data (command 03H followed by 00 00 00 for start of address space) yields all FF in response. For this reason, I'm not sure if I'm able to set write enable (command 06h) or write some bytes (command 02H followed by 00 00 00 for start of address space followed by some bytes.)WHAT I'VE DONE SO FAR: I've looked at library code I've found online, however, what I've found so far is written for general case and intended for production, not so much geared to beginner just trying to get a few initial commands and responses working.WHAT HELP IS NEEDED: As I'm writing for a specific target microprocessor using GCC, I've not posted my existing code; rather I'm looking for a pointer to "how to get started with SPI flash" sort of tutorial or otherwise basic-level example(s).Thanks for any pointers,Dave

author: wb0gaz
author_rank: Frequent Contributor
timestamp: February 14, 2022, 03:19:52 pm
content: Problem was solved - turns out didn't read closely enough the datasheet which showed timing for "write enable" (specifically, that is a single byte transaction, must terminate CS-low after the 8 bits are written.
Another old AMI Chip - Page 1
Forum section: electronics / general

author: MisterDulister
author_rank: Newbie
timestamp: February 11, 2022, 05:17:42 pm
content: Hi, after reading this:https://www.eevblog.com/forum/microcontrollers/old-mystery-chip-(ami)/i registered to this forum, because i have a similar chip which i cant find any information about. Maybe here is someone who can help me figure out what it is? I have like 5 of them. I once got a box full of ICs as a gift where they were included. Many thanks already.

author: cdev
author_rank: Super Contributor
timestamp: February 11, 2022, 05:32:45 pm
content: Maybe it's an old AMI BIOS chip?

author: harerod
author_rank: Frequent Contributor
timestamp: February 11, 2022, 05:46:12 pm
content: September 1976, a vintage S1757 UART.On sale on ebay. Search term: "S1757 ami"

author: MisterDulister
author_rank: Newbie
timestamp: February 11, 2022, 06:18:11 pm
content: Mhm sounds intersting: 'It includes the pictured also very vintage AMI S1757 ceramic CPU with grey trace. 'But I think I wont get any datasheet of this...?

author: wek
author_rank: Frequent Contributor
timestamp: February 12, 2022, 08:37:11 am
content: It appears to be aUARTfromAmerican Microsystems.JW
MIPI screens for STM32, quantity of data lanes. - Page 1
Forum section: electronics / general

author: luiHS
author_rank: Frequent Contributor
timestamp: February 09, 2022, 11:01:58 pm
content: Hello.I have several designs to make, some already advanced, using small screens. I decided to use MIPI interface because they need much less tracks than a parallel interface.The problem is that I find some screens that interest me because of their size (3.95 inches square), but their MIPI interface is for 4 data lanes, when my hardware can only handle up to 2 data lanes.On the other hand, NXP evaluation boards are using 4 data lane displays, even though the RT1176 microcontrollers can only handle up to 2 data lanes on their MIPI interface.The strange thing is, for example, that I find 800*480 resolution screens that are controlled with 2 data lanes, and others of 640*480 or 720*720 that have 4 data lanes. I thought that depending on the resolution of the screen, more or less data lanes are needed.The question is if it is possible to handle with only 2 data lanes a MIPI screen that has 4 data lanes in its pinout. Perhaps the resolution is lower, something that does not worry me, I could continue using them for my applications.

author: thm_w
author_rank: Super Contributor
timestamp: February 10, 2022, 01:12:13 am
content: QuoteDo they provide schematics or code for their eval boards that you can look at?Maybe they are sacrificing update rate, color depth, or some other aspect.

author: luiHS
author_rank: Frequent Contributor
timestamp: February 10, 2022, 02:49:12 am
content: Yes, NXP and ST provide schematics of their evaluation boards.https://community.nxp.com/t5/i-MX-RT/LPSPI-in-interrupt-amp-eDMA-mode-not-working-in-RT1170-EVK/m-p/1384447?attachment-id=126920I read something that in some MIPI screens 4 data lanes can be used with 2 data lanes, that can limit the fps, but still it seems that they must be configured by hardware to define how many data lanes are used, and that is not available in all screens.I found this document about using 4 data lane displays with STM32H7 microcontrollers.https://pcbartists.com/design/embedded/using-4-lane-mipi-dsi-display-with-stm32-2-lane-dsi-host/Now I'm thinking of doing some projects with parallel RGB screens, it will be more complicated to route the PCB, but I won't have this problem.
SOLVED: Print IP from ESP32-WROOM in Station Mode using ESP-IDF API - Page 1
Forum section: electronics / general

author: GreyArea
author_rank: Contributor
timestamp: February 06, 2022, 11:50:45 am
content: I'm trying to obtain the IP address assigned to the ESP32 FreeRTOS TCP/IP stack when in Station mode. I'm using ESP-EDF 4.3.2 on a ESP32-WROOM.The API call do this appears to be esp_netif_get_ip_info() [https://github.com/espressif/esp-idf/blob/master/components/esp_netif/include/esp_netif.h#L440-L453]I took the ESP-IDF example from `examples/wifi/getting_started/station` added the function below, but although I see the IP address in the startup output (I'm using a NodeMCU dev board), I can't seem to print the IP.I suspect the problem to be in the IP address conversion and print, but I can't seem to spot the problem.Code:```cvoid print_ip(){while(1){printf("Entering print_ip()...\n");esp_netif_ip_info_t ipInfo;char str;esp_netif_t* netif=NULL;netif = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF");if (netif == NULL)printf("Couldn't get handle.\n");else{// If we got a handle, show the address.printf("Pointer is: 0x%" PRIXPTR "\n", (uintptr_t)netif);// Copy the netif IP info into our variable.esp_netif_get_ip_info(netif, &ipInfo);// Convert the variable into a string.esp_ip4addr_ntoa(&ipInfo.ip, str, strlen(str));printf("%s", str);}vTaskDelay(1000 / portTICK_PERIOD_MS);}}```Changes to app_main():Code:```cwhile(1){printf("Ping\n");print_ip();vTaskDelay(1000 / portTICK_PERIOD_MS);}```

author: GreyArea
author_rank: Contributor
timestamp: February 06, 2022, 03:23:45 pm
content: I'll answer my own questions for anyone else struggling this this, I think the problem was more about trying to modify C array types. here is a working version:Code:// void print_ip(void *parameters)void print_ip(){while(1){printf("Entering print_ip()...\n");esp_netif_ip_info_t ip_info;esp_netif_t* netif=NULL;netif = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF");if (netif == NULL)printf("Pointer is NULL.\n");else{// If we got a pointer, show the address.printf("Pointer is: 0x%" PRIXPTR "\n", (uintptr_t)netif);// Copy the netif IP info into our variable.esp_netif_get_ip_info(netif, &ip_info);printf("My IP: " IPSTR "\n", IP2STR(&ip_info.ip));printf("My GW: " IPSTR "\n", IP2STR(&ip_info.gw));printf("My NETMASK: " IPSTR "\n", IP2STR(&ip_info.netmask));}vTaskDelay(1000 / portTICK_PERIOD_MS);}}
One wire communication options? Other than 1-Wire/Lin - Page 1
Forum section: electronics / general

author: JPortici
author_rank: Super Contributor
timestamp: February 02, 2022, 03:48:24 pm
content: Hi,It just happens that i have a couple spare pins on a connector (data+gnd, or 2xdata hoping that common ground is enough), that could be dedicated to a low data rate bidirectional communication line between multiple devices, in a noisy environment.Actually, most of the time it would be a kind of master -> slave communication, like master says "open" or master says "data is XXX" and little, if any, communication from slaves.-If only i hadn't ran out of UARTs on the candidate MCU i would just add another LIN transceiver and be done with it.-1 wire is an option but the data rate is too low - or resource consumption is too high if i increase the data rate --well maybe not too high, in the board i'd be also emulating HCS so i already have a 10kHz interrupt running constantlyWith these premises, what my options could be?- Emulate UART -> LIN- Emulate 1wire- Another protocol that can be made running on one wire that can leverage other peripherals on board

author: Ian.M
author_rank: Super Contributor
timestamp: February 02, 2022, 04:11:57 pm
content: Is 450 bytes/sec fast enough? If so simply use your 10KHz ISR for a 5 Kbps 9N1 async addressable soft UART over LIN transceivers. If you need to push it a little bit faster, using longer words could push it up to around 600 bytes/sec at the expense of needing closer tolerance oscillators, and more overhead on short messages.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 02, 2022, 04:18:23 pm
content: ... or add another 10kHz interrupt source and divide the work between the two interrupts, for double the data rate.I agree that software UART is simple enough. And the ability to do 9-bit word allows you to do packet delimitation (mark the address with 9th bit) as discussed in another thread recently.

author: fchk
author_rank: Frequent Contributor
timestamp: February 04, 2022, 11:53:14 am
content: Microchip has got UNI/O devices, like this one:https://ww1.microchip.com/downloads/en/DeviceDoc/11AA02E48-11AA02E64-2K-UNIO-Serial-EEPROMs-Data-Sheet-20002122E.pdfhttps://ww1.microchip.com/downloads/en/Appnotes/01194B.pdffchk

author: NorthGuy
author_rank: Super Contributor
timestamp: February 04, 2022, 03:35:53 pm
content: May be you can temporarily borrow an UART module and reconnect it to different pins.UART is the easierst no matter what. You can install a pullup and use open-drain pins to use the same wire for bidirectional communications. This will be somewhat slower. Or you can switch direction, which is a little bit more work. One of the AVR programming interfaces work this way.If you do have 2 signal wires, SPI will work better - one line for a clock, other wire bidirectional data.
Zilog Z8 ZDS3.68 (Z8611/Z8613) code simulator - Page 1
Forum section: electronics / general

author: Kjo
author_rank: Regular Contributor
timestamp: February 04, 2022, 03:30:55 am
content: I need to work on some ancient Z8 code. I have the Zilog ZDS3.86 Development studio that does support these early Z8s. So I can write and assemble code with the ZMASM fine. But I see the appearance of a simulator bug in writing to the control registers. There are 5 write only registers used for I/O configuration. On the ZDS3.86 these registers are in green and always FFh. I understand that reading write only regs returns FFh, but register windows should show the actual value!The Z8Encore simulator behaves as I expect, showing the values of the write-only regs, but does not support these old Z8 devices.Anyone have some long forgotten knowledge of this problem?kjo - KO3Y
Openocd write_image erases all sectors when writing code? - Page 1
Forum section: electronics / general

author: julian1
author_rank: Frequent Contributor
timestamp: February 02, 2022, 06:51:46 am
content: I have some code to read and write my own data to flash sector 2 (16kB) on stm32f4. My preference is a low numbered sector because it uses less flash resources (16kB versus 128kB).I changed the linker script to place the vector table and reset handler at sector 1 (0x08000000) as the arm runtime expects. But then moved the .text and following link sections to start at sector 4 (0x08010000). This allows me to write sector 2 with my own data, without overwriting elf code. It works well enough, and I can persist data across power up/down cycles.But what doesn't work as well - is the openocd flash_write command which erases all sectors between valid code sectors - even if there is no code for that sector. So when new firmware is flashed, my data is erased.There is no way to change this behavior from the documentation that I can see.Is there another way to do what I want to do - simply?The alternatives look quite a bit more complicated - involving a separate boot binary and then a main binary. And with all the gcc/g++ pre_init symbols I am not quite sure how to go about managing the jump from the boot to the main binary.

author: julian1
author_rank: Frequent Contributor
timestamp: February 03, 2022, 04:10:36 am
content: For interest, a workaround is to copy out the sector data, flash, then restore. As an openocd proc,Code:proc myflash {} {# haltreset halt# copy out 100 bytes serialized data, from sector 2, ie local offset to 0x08000000flash read_bank 0 out.txt 0x08000 100# flash firmware, erase/overwrites all sectorsflash write_image erase unlock ./my.elf;# Now write data back to sector 2flash erase_sector 0 2 2 ;flash write_bank 0 out.txt 0x08000# restart mcu etc# reset run}
Original ST-Link V2 firmware - Page 1
Forum section: electronics / general

author: Amper
author_rank: Frequent Contributor
timestamp: February 01, 2022, 10:55:12 am
content: Hi!I just found an original stlink V2 in the dumpster, the stm32f103 is fried, most likely the thing got zapped by powerelectronics attached to the prog header.Is there a compatible firmware out there?Im especially interested in the ability to program stm8 wich i dont know the knock offs to be able to do.ST offers fw updates but can i also just download a .bin?Hopefully someone knows a path to revive that thing.

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 01, 2022, 11:56:58 am
content: https://www.eevblog.com/forum/microcontrollers/dumping-stlinkv2-from-usb/msg3963365/#msg3963365Edit: I made this last year as an emergency fix.https://www.eevblog.com/forum/reviews/stm32-oled-digital-soldering-station-for-t12-handle/msg3350424/#msg3350424ST-Link 4.3.0 worked well, newer versions didn't, since ST removed older versions, I uploaded ithere

author: Amper
author_rank: Frequent Contributor
timestamp: February 01, 2022, 01:10:21 pm
content: Oh wow, i guess every topic has been talked about beforeThanks!

author: GromBeestje
author_rank: Frequent Contributor
timestamp: February 01, 2022, 08:16:05 pm
content: Find the ST Link Bootloader herehttps://github.com/Krakenw/Stlink-BootloadersMind to use the 2.0 for STM32F103C8T6 and the 2.1 for STM32F103CBT6Then find an older updater, as newer ones block a blank device. V30-ish should be ok I think.Some old versions could be found herehttp://nic.vajn.icu/PDF/STMicro/STLink/When that is flashed, you should be able to update to the latest version without problems.

author: Amper
author_rank: Frequent Contributor
timestamp: February 02, 2022, 08:23:35 am
content: It worked, ST-Link is working againThanks!
Attinyxx26 SPI not turning on TFT screen - Page 1
Forum section: electronics / general

author: Gabe_from_Onda
author_rank: Newbie
timestamp: January 31, 2022, 05:25:14 pm
content: Hi. I'm trying to get an attiny1626 to communicate with a 2" TFT screen over SPI(using megaTinyCore in the arduino IDE). The screen is equivalent tothis adafruit screenwith the same size, resolution, and ST7789 controller. I got an arduino nano to work with adafruit's example code & GFX Library, but when I edit the pins to match what I'm using on the attiny1626, the backlight turns on, but nothing else happens. The SPI is operating at 1MHz, and I already turned on an oscilloscope to look at the clock, data, SS, Reset, and backlight pins and all of the signals seem to be on the right pins and the signals seem clean i.e. clean square waves with no major spikes or signal noise. I can get access to a logic analyzer to see what the attiny is sending compared to the arduino nano, but I feel like I'm just throwing stuff at a wall to see what sticks at this point. Any other things I should be checking beforehand?
Want to know WCET for an SPI ISR dsPIC33FJ12MC201 - Page 1
Forum section: electronics / general

author: perdrix
author_rank: Frequent Contributor
timestamp: January 30, 2022, 03:49:25 am
content: I've written an SPI ISR for a dsPIC33FJ12MC201. I would like to know how to determine the Worst Case Execution Time (WCET) for that code (or at least a reasonable approximation) . I'm using the free version of MPLAB. Nested interrupts arenotallowed.The clock code setup is:Code:#ifdef XTAL#pragma config FNOSC = PRIPLL // Primary Oscillator (XT, HS, EC) w/ PL#pragma config POSCMD = XT // XT Oscillator Mode#pragma config IOL1WAY = OFF // Allow Multiple Re-configurations#else#pragma config FNOSC = FRCPLL // Internal Fast RC (FRC) w/ PLL#pragma config POSCMD = NONE // Primary Oscillator Disabled#pragma config IOL1WAY = OFF // Allow Multiple Re-configurations#endifvoid init_clock(void) {#ifdef XTALSetPreDiv(5); // 10MHz / 5 = 2MHzSetPLLdiv(72); // 2MHz * 72 = 144MHzSetPostDiv(2); // 144MHz / 2 = 72MHz#else//// 7.372800 MHz + 25 steps of 0.375% = 8.064000MHz//SetOscTun(25); // 9216 * (800 + 3 * 25) = 8064000SetPreDiv(7); // 8064KHz / 7 = 1152KHzSetPLLdiv(125); // 1152KHz * 125 = 144MHzSetPostDiv(2); // 144MHz / 2 = 72MHz#endif}The internal oscillator is being used, not an external XTAL. I *think* the comments in initclk() are correct, if not please could you put me straight.Thank you, David

author: DavidAlfa
author_rank: Super Contributor
timestamp: January 30, 2022, 07:44:39 pm
content: ReadDS70000600DInterrupt latency is decribed in page 16. Better you read it whole to better understand how it works.MPLAB is always free. It's the compilers which have PRO version.Most microchip compilers let you use O2 optimizaton for free, no restrictions. which is already a pretty nice optimization level.You can use MPLAB SIM, setting breakpoints at the start and end of the ISR, check the core cycle counter, and use it to calculate the execution time.After reading DS70000600D you'll know the ISR delay is 13 cycles, so add them to the counter value.