hybridfree/eevblog-posts huggingface dataset:
Consistently wrong device ID from Lattice MachXO2 FPGA - Page 1
Forum section: electronics / general

author: cebrax
author_rank: Contributor
timestamp: June 29, 2018, 11:06:35 am
content: Hello,I have created a JTAG programmer using FT2232 (I've attached the schematics) and bought 2 pieces of LCMXO2-256HC-4SG32I to start working with FPGAs. For my first programming attempts, I didn't have any success. I had a VCC for Bank 0 not connected. I've connected this wire and I had success, however my program didn't work as intended, actually it didn't work at all.I then tried programming again and again and again, but no luck. It was giving me "Failed in Function CHECK_STATUS" or "Failed in Function FLASH_ENABLE" errors. But, it was reading the DEVICE_ID correctly and moving on and then failing.Now, I am facing with a VERY strange issue, the DEVICE_ID is read as 0xA0C03E00 instead of correct DEVICE_ID 0x012B8043 for this chip. And it is doing this consistently. I have checked JTAG signals and they seem to confirm 0xA0C03E00. Oscilloscope shot is below.Code:Starting: "pgr_program run"INFO - Check configuration setup: Start.Device#1 LCMXO2-256HC: Failed to verify the ID(Expected: 0x012B8043 Read: 0xA0C03E00).ERROR - Check configuration setup: Unsuccessful.ERROR: pgr_program failed.ERROR - Programming failed.Blue Channel: TCKYellow Channel: TDOAnybody has any idea?

author: cebrax
author_rank: Contributor
timestamp: June 29, 2018, 12:41:31 pm
content: Somehow I have changed the DEVICE_ID by somehow setting MY_ASSP to ON and giving CUSTOM_IDCODE of 0xA0C03E00. I really don't know how this happened. I have created a SVF file and edited the DEVICE_ID part using Deployment Tool and run it with Download Debugger. I don't know how this all happened, but it works now.From Technical Note TN1204:Quote
STM32f4xx Reading/Writing data to flash - Page 1
Forum section: electronics / general

author: aleksa21
author_rank: Newbie
timestamp: June 26, 2018, 10:21:32 am
content: I am new to the forum, and sorry if this is the wrong place to ask this question. I have recently started using STM32f407 board and i can't find a proper example on reading/writing data into flash memory?And does someone know a good online course or tutorial about programming STM32f4 boards with CubeMX and IAR IDE?

author: Dubbie
author_rank: Unknown
timestamp: June 26, 2018, 10:43:31 am
content: The "mastering STM32" book is based on cube and I found it useful to learn my way around the HAL and the various features of the chip.

author: aleksa21
author_rank: Newbie
timestamp: June 26, 2018, 12:31:03 pm
content: Found it, seems really good. Thanks a lot mate.
Generating multiple .hex or .bin files with different  #define in Keil - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: June 25, 2018, 02:19:35 pm
content: Hi,Suppose that I have a project in keil and I have written my code that certain options would be enabled or disabled based on the #define's in my Code, I want to know if it's possible to change the final output file name based on these switches so that I can get ride of renaming different output file names by hand, is there any way to do that?

author: funkathustra
author_rank: Regular Contributor
timestamp: June 25, 2018, 02:52:55 pm
content: Assuming you're talking about Keil C51 and not MDK or one of their other compiler toolchains, OH51 is the Keil utility that µVision invokes to create hex files from omf binaries the assembler spits out. Neither it nor the assembler has any ability to parse C preprocessor macros, so what you're asking is not possible.Instead, consider defining multiple targets in µVision and define your build symbols in that target configuration. Then, you could create a batch file that builds each targetCode:uv4.exe -b PROJECT.UVproj -t"blinky"uv4.exe -b PROJECT.UVproj -t"blinky-no-rtc"...

author: rstofer
author_rank: Super Contributor
timestamp: June 25, 2018, 05:03:47 pm
content: Does the toolchain provide a Make utility? If so, just create Makefiles and define the options as compiler command line options (assuming it supports command line options). You might also be able to use ANY Make program, there's nothing special about the GNU or Microsoft versions. They're just Make...See -Dname=defhttp://www.keil.com/support/man/docs/armcc/armcc_chr1359124194749.htmBasically, internal #defines are the default values unless overridden by -Dname. In your source, you test to see if your name is already defined. If not, you use the #define. If it is, you use the current definitionin your source code:#ifndef myvariablemyvariable = 15#endiffrom the command line:<compiler command> -Dmyvariable=32 ...If the -D option is given, myvariable will have a value of 32 else 15Value isn't the right word. #defines are macro substitutions, not values. Sometimes it is easier to think of them as values.

author: photovore
author_rank: Newbie
timestamp: June 26, 2018, 06:28:58 am
content: You can also do this entirely over the Gui.First create the different Project Targets: Project->Manage->Project Items and create new targets unter the Project Targets submenu.For each of these targets you can create a different output filename under Project->Option for Target->Output->Name of Executable.Any conditional #defines can be set or disable under Project->Options for Target->C/C++ in the Define input field. Each target can have its own unique defines.Using a Batch Build or Batch Rebuild will build all of your project variants with one mouse click.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: June 26, 2018, 10:03:20 am
content: Thanks for your hints, I;m using MDK for ARM Cortex, So let me try to see what I can get
mpu6050 angle data - Page 1
Forum section: electronics / general

author: huseyink
author_rank: Contributor
timestamp: July 06, 2018, 01:41:23 pm
content: HiI read gyro and accel data from MPU6050. It is fine. But I wanna read the angle data from MPU6050.Which calibration should I do? I mean that pitch_angel and roll_angle..

author: JoeWright
author_rank: Newbie
timestamp: July 08, 2018, 10:19:54 am
content: You will need to get the quarternian data from the DMP. Problem is, despite invensense hyping the DMP feature of their chips, the documentation is terrible. For some of the chips you literally have to reverse engineer their example code if you want to know how to use it, but since the code is very badly written (even including bugs that prevent compilation), that's a tough ask. If their support was good this wouldn't be an issue, but they don't interact with their forum, and don't answer emails. They give the impression that they are going bust. Obviously they are not, but they do give that feeling. Shame really, great products, lousy support. And you do want to use their DMP rather than do your own sensor fusion as they have done a very good job on the algorithms in comparison to standard techniques (that I have seen anyway).Anyway, rant over. Get on to the Invensense site, find the developer section, download the software for the 6050 and get that running. I seem to recall that they do actually have documentation for the 6050 dmp on there as well, its just some of the newer chips that have that missing. Whether or not that documentation is enough to code your own, or if you have to start with their software, I'm not sure for the 6050. For some of the other chips they do stuff in their code that is simply not covered in the docs.For one of the chips, the dmp documentation was on the shop page, not in the developers section, so you might want to hunt around or google for it.Getting the dmp up and running is a lot more complicated than getting the raw acc and gyro data out so be prepared to spend some time. Start with getting their software working and move on from there.
Exit VIM Speedrun - Page 1
Forum section: electronics / general

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 25, 2018, 09:11:20 am
content: Enjoy...Tim

author: Whales
author_rank: Super Contributor
timestamp: June 25, 2018, 10:08:25 am
content: This sucks. Completion speedruns take too long.I'll wait for an any%

author: Berni
author_rank: Super Contributor
timestamp: June 25, 2018, 10:19:14 am
content: Yep that's pretty much me in VIM. But i eventually found an exploit by closing the SSH terminal and opening a new one to cut my speedrun time down significantly.I just keep using Nano because i actually know how to use it.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 25, 2018, 02:47:30 pm
content: Every time I try to use VIM:<typetypetypetype...>"Shit, I'm not in insert mode! And now it's in some weird function that I don't know how to get out of. And I haven't saved my file..."<kills process>Nano for the win.

author: bd139
author_rank: Super Contributor
timestamp: June 25, 2018, 03:33:43 pm
content: Been using vim for 21 years now. After about 10 it becomes an extension of your body.

author: agehall
author_rank: Frequent Contributor
timestamp: June 26, 2018, 05:12:58 am
content: I don't mind VIM and I really don't understand how computer folks still avoid it like the plague - it's a rather nice little editor and the basics are not that hard to remember.As any real programmer would, I do prefer Emacs though but I must admit that as of late I've started cheating a bit by using Visual Studio Code. It makes me feel a bit dirty, but hey, it's progress...

author: Nusa
author_rank: Super Contributor
timestamp: June 26, 2018, 06:35:26 am
content: I first started using ex and vi in 1978. So that's 40 years for me.

author: boffin
author_rank: Unknown
timestamp: June 26, 2018, 06:44:22 am
content: Quote from: HwAoRrDk on June 25, 2018, 02:47:30 pmTry stepping up to joe. It's simple like nano, but has some power if you look for it.
Trouble with RFM96 sending packets? - Page 1
Forum section: electronics / general

author: Boscoe
author_rank: Frequent Contributor
timestamp: June 18, 2018, 08:40:44 pm
content: Hi all,I wonder if I can get some advice on this device?I'm writing a driver to send packets on this radio. I have basically copied the register settings from the init and send functions from the Adafruit Arudino library.https://github.com/adafruit/RadioHead/blob/master/RH_RF95.cppI get successful SPI comms with the radio, I can read and write registers, fine. The hardware is good, the schematic is right and working.My problem is I can't send on the radio. To send you do the following:- Put the radio into standby mode- Fill the FIFO with the data to send.- Set the length of the data.- Put the radio into TX mode.- Wait for interrupt for completion.What I get:- Put the radio into TX mode.- Wait for interrupt for completion.- The interrupt doesn't happen even if I wait for 10 minutes.- Retry sending, on about the 5/6th time, I'll get the interrupt. The result is channel activity detected.- I then never get another interrupt despite how long I wait or number of times I try sending a packet. I have to reset and reconfigure the radio before the above happens again.With the current setup do I need to set more registers? Are there more than the two functions that I mention? Any advice for what might be happening?Thanks

author: Boscoe
author_rank: Frequent Contributor
timestamp: June 25, 2018, 08:24:59 pm
content: Does anyone have any ideas? Anything would really help! Thanks.
NodeMCU suddenly cannot connect to internet - Page 1
Forum section: electronics / general

author: panoss
author_rank: Frequent Contributor
timestamp: June 25, 2018, 06:51:58 am
content: My NodeMCU was, till yesterday, very easilly connecting to the internet.Untill I installed a library,Thermistor_library-master.From that moment the NodeMCU can no way connect to the internet!!!I removed the library (deleted the library 's folder from C:\Users\Pan\Documents\Arduino), I tried previous sketches that worked 100% in the past, but NOTHING!It cannot connect.I even tried another (unused) NodeMCU and the same thing happens!I 'm desperate, I don't know what to do!Any help is welcome.(I have made no changes to the router 's credentials or any of it 's settings)

author: Naguissa
author_rank: Regular Contributor
timestamp: June 25, 2018, 12:11:36 pm
content: Have you tried most simple solution? Restarting your WiFi/Router....Sometimes routers, APs and so on goes nuts.....Quote from: panoss on June 25, 2018, 06:51:58 am

author: panoss
author_rank: Frequent Contributor
timestamp: June 25, 2018, 02:05:08 pm
content: Yes, I tried this.Well the solution was that I replaced this code:Code:WiFi.begin(ssid, password);with this:Code:WiFi.disconnect(true);WiFi.setAutoConnect(false);WiFi.setPhyMode(WIFI_PHY_MODE_11G);WiFi.begin(ssid, password);WiFi.printDiag(Serial);Serial.println(WiFi.getPhyMode());and...got connected!!!Then I removed the new code and replaced it with the old one:Code:WiFi.begin(ssid, password);and works fine too!!!I have no idea why the use of the previous code 'cured' it!!
Stm32 i2c communication hal library - Page 1
Forum section: electronics / general

author: huseyink
author_rank: Contributor
timestamp: June 21, 2018, 11:59:36 am
content: hi everyoneI cant understand i2c module in hal library. I cant understand how the functions process in the program. Ex : hal_i2c_master_transmit() and hal_i2c_master_receive. Can someone explain processing of these function and give me an example project.Thanks

author: mbless
author_rank: Regular Contributor
timestamp: June 21, 2018, 08:31:20 pm
content: How about you post your code, explain what you are trying to do, and say why error you get?

author: huseyink
author_rank: Contributor
timestamp: June 22, 2018, 03:08:17 pm
content: Quote from: mbless on June 21, 2018, 08:31:20 pmI did not get an error. I just wanna learn the explaination i2c with hal lib. So what is the code processing? How does it work?

author: newbrain
author_rank: Super Contributor
timestamp: June 22, 2018, 05:22:27 pm
content: Quote from: huseyink on June 22, 2018, 03:08:17 pmIt's still not really clear what you're after...It's not at all clear what your competence level is in C and embedded code.This makes it next to impossible to answer.If you are looking for an explanation of how tousethe I2C HAL, I would suggest studying:The long "How to use this driver" comment at the beginning of the HAL I2C C file, e.g., for an F4 in stm32f4xx_hal_i2c.c - it's terse, but a good guide.The various project examples, also contained in the Cube packageIf you want to understand how the HAL codeworks, you can start by reading the reference manual for your specific STM32 family, matching the descriptions and usage suggestions there with the actual HAL code.If there are parts that you cannot understand, show that you have made an effort, ask specific questions and many here will be happy to help.In any case, it's not fun code to read.
ATmegaa32U4 USB with internal RC clock Burn Bootloader - Page 1
Forum section: electronics / general

author: Harmony
author_rank: Newbie
timestamp: June 22, 2018, 02:26:57 am
content: Does anyone know how to Burn Bootloader to ATmegaa32U4 with internal RC clock?When I plug my custom Atmega32u4 PCB connects to Windows, it shows 'Unknown USB Device'. I think it's because I didn't put the crystal on, but ATmega32U4-AU has default external XTAL.So, I want to Burn Bootloader to ATmegaa32U4 with internal RC clock. I have read this post:https://www.eevblog.com/forum/microcontrollers/atmegaa32u4-usb-with-internal-rc-clock/But I dont know how to use the "Caterina.hex" and "makefile". I have searched some relative information online, but still couldn't figure out.Please helpI am using an Arduino Uno as a programmer via the ISP interface.My computer is Windows 10.
Basics of finding malicious software using singals and power analysis? - Page 1
Forum section: electronics / general

author: CopperCone
author_rank: Super Contributor
timestamp: June 21, 2018, 02:03:40 pm
content: Is there a primer on this stuff? I have seen industrial catalog advertizements for things you plug into pld power supplies which monitor them for weird behavior.I dont know much about how os work and backbones of modern processors but i figure it would be interesting discussion
Advices on "Learn ESP32 with Arduino IDE" from randomnerdtutorials.com - Page 1
Forum section: electronics / general

author: AlcidePiR2
author_rank: Regular Contributor
timestamp: June 19, 2018, 08:14:29 pm
content: Hi EverybodyI just received an ad from "https://randomnerdtutorials.com/"for a series of lectures and book on "Learn ESP32 with Arduino IDE"https://randomnerdtutorials.com/learn-esp32-with-arduino-ide/Does anybody has some experience with these ?

author: bitseeker
author_rank: Super Contributor
timestamp: June 19, 2018, 09:40:15 pm
content: Nope. There's lots of info freely available on the web for programming the ESP32 using various development platforms and languages. Also check YouTube for tutorials.

author: AlcidePiR2
author_rank: Regular Contributor
timestamp: June 20, 2018, 03:35:41 am
content: Yes, you are probably right.The available ESP32 doc on the Web should be the first place to go.I have look to his freely available books, and to the repository of the code on github, and I am far from impressed.

author: martinayotte
author_rank: Regular Contributor
timestamp: June 20, 2018, 02:34:40 pm
content: https://leanpub.com/kolban-ESP32
STM8L and STM8S resets abruptly and takes a lot of current during sleep - Page 1
Forum section: electronics / general

author: allantommathew
author_rank: Newbie
timestamp: June 20, 2018, 05:58:15 am
content: Hi friends,We are using STM8L(STM8L051F3) and STM8S (STM8S003F3) for a project. I has been designed, developed and deployed. It works as expected - STM8L as a transmitter, wakes up from stand-by mode, collect some data, transmits it and goes back to stand-by mode and STM8S as a receiver, receives it and represents it visually. This set up has been deployed and working for over a year now.Now we redesigned the board with some extra functionality. We made the board and soldered the components but the new board continuously resets after 10-20 mins of operation. This is evident in both STM8L and STM8S. After a "cool off time" of about 10-20 mins the board again works but back to the erratic behaviour after 10-20 mins.On further evaluation we saw:inconsistencies with the NRST pin. The voltage of NRST pin is not constant at 3.3V but changes abruptly. This brought us to a similar problem faced by another person (link) but the findings were inconclusive.It would vary between 1-2V when the debugger is not connected and between 2.2-2.6V when the debugger is connected.during the standby mode, the sleep current that the board takes is very high (it was around 0.8µA to 1.5µA in the previous design but it is around 35µA to 2mA, which is very high for a battery operated device).Thus, we understand that the new design is not working properly.We tried doing some more things for analysis:The new board was very similar to the old one. So we tried running the previous hex file (the deployed one) on the new board, but it showed the same problem (so there may not be an error in the code).The new micro-controller was soldered on the old board with the old code (the deployed hex file). But the old board started having the same issues as above (so we felt it has something to do with the micro-controller).Please let me know if more information is needed, regarding schematic or waveforms or anything that can aid in decoding the problem. I would be obliged if anyone could guide me in the right direction.Thank you.With regards,Allan.
Arduino and interrupts with rotary encoder. - Page 1
Forum section: electronics / general

author: medical-nerd
author_rank: Regular Contributor
timestamp: June 15, 2018, 11:39:33 pm
content: HiyaI want to control a Si5351a dds using a 200ppr optical rotary encoder. All the previous examples I have seen just use the bog standard 16ppr mechanical encoders.I have looked at the options and using interrupts seem to be the best - does anyone know if an arduino can handle the speed of such an encoder?Paul's optimised library seems ideal but using a teensy 3.2 just for this looks like overkill - I'd rather just use a nano clone but its not clear if thislibrary is just for teensy . Any advice before I start?Cheers

author: obiwanjacobi
author_rank: Super Contributor
timestamp: June 17, 2018, 06:17:52 am
content: Is a Si5351a a motor? (couldn't find it on a quick search)Depends how fast the decoder will be spinning (rpm of the motor) and what amount of work needs to be done in the ISR (keep it short) and the clock speed of the processor - for a standard Nano that would be 16MHz.My gut feeling says it should be okay.My advice would be to make the investment of a Arduino Nano and simply go try stuff and measure.

author: retrolefty
author_rank: Super Contributor
timestamp: June 17, 2018, 07:30:12 am
content: Yes you should have no problem utilizing a arduino nano to control your DDS module. I used one to control a AD9850 DDS module several years ago. You can even utilize/configure your 200 ppr encoder to generate either 200, 400, or 800 interrupts per step by utilizing either a single user interrupt pin or both user interrupt pins and either 'falling' or 'change' interrupt triggering.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: June 17, 2018, 07:53:11 am
content: You need to time the ISR in clock cycles and see, because at say 3000 rpm it's going to be triggered 200*3000/60 -> 10 thousand times a second.And be prepared for the overall slowdown in any other code you're running in the arduino because it's going to be being interrupted quite often.Libraries that depend on software timing loops might misbehave/stop working well when heavily interrupted.

author: MarkF
author_rank: Super Contributor
timestamp: June 17, 2018, 08:20:26 am
content: The encoder will be turned by a human.The Si5351A is a Programmable Any-Frequency CMOS Clock Generator chip.https://www.silabs.com/documents/public/data-sheets/Si5351-B.pdfI would keep the interrupt routine as short as possible. Only keep track of how many clicks CW or CCW have occurred and save the count. Then use the resulting count inside your main processing/control loop. (i.e. read->store copy->clear count and then use stored copy in main loop to control the Si5351A). That way the main control loop can process encoder changes without missing any encoder input.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: June 17, 2018, 08:26:29 am
content: Ohh, sorry. Then no matter what any arduino is plenty fast, no problem.
CFB amplifiers as comparators, advice?  - Page 1
Forum section: electronics / general

author: Boscoe
author_rank: Frequent Contributor
timestamp: June 15, 2018, 08:28:17 pm
content: Hi all,I'm trying to use an EL5166 as a CCD clock driver running at 28MHz which needs a voltage swing from -4.5 to 1.5V and a rise time of 3ns or less. I selected this op amp for it's 6000V/us slew rate and high output current which are the limits I've hit before. However I get a small 200mVpp highly distorted output waveform at any frequency by holding the inverting input at 1.5V and applying a 3.3V square wave signal from the FPGA into the non inverting input. I'm using a +/-4V supply for this test.I'd appreciate some advice for driving CCD clocks. Here are the requirements:- High slew rate needs 8V in 4ns rise and fall.- Maximum 10V working voltage.- Current output of at least 100mA peak.This means a lot of high speed voltage comparators are out due to working at a maximum of 5.5V, and MOSFET gate drivers are too slow. Buffered op amps are difficult to get the speed and limit cross conduction.Thanks!

author: nctnico
author_rank: Super Contributor
timestamp: June 15, 2018, 09:34:20 pm
content: Start by not overdriving the input of the opamp. In other words: set the amplification of the OPAMP and feed it a signal with the appropriate input level. Rule number one of using opamps: never use an opamp as a comparator!

author: David Hess
author_rank: Super Contributor
timestamp: June 16, 2018, 10:10:56 am
content: I looked up an old Tektronix CCD design (7D20) and they used a complementary pair of RF bipolar transistors in an open loop class-b common emitter amplifier to do the level shift from logic levels.

author: Boscoe
author_rank: Frequent Contributor
timestamp: June 16, 2018, 10:57:18 am
content: Quote from: nctnico on June 15, 2018, 09:34:20 pmI've never heard of this. Why is this the case?

author: Boscoe
author_rank: Frequent Contributor
timestamp: June 16, 2018, 10:58:27 am
content: Quote from: David Hess on June 16, 2018, 10:10:56 amThanks, I'll get on the simulator and try this out.

author: David Hess
author_rank: Super Contributor
timestamp: June 16, 2018, 12:26:05 pm
content: Quote from: Boscoe on June 16, 2018, 10:57:18 amOperational amplifiers just make poor comparators. They are not designed to operate with their internal nodes in saturation and frequency compensation limits their speed.Quote from: Boscoe on June 16, 2018, 10:58:27 amI would not necessary copy what Tektronix did exactly. I linked it just to give an idea of what has been done in the past and I think a saturated level shifter is the way to go even if that means a discrete output stage.A linear amplifier with the output characteristics you specified is feasible but if it also has to operate in saturation, then the linear operation part might as well be skipped.
Hierarchical state machines, does anyone have a pattern or framework? - Page 1
Forum section: electronics / general

author: jnz
author_rank: Frequent Contributor
timestamp: June 15, 2018, 05:51:38 pm
content: I have a project I'm working on, it has like 5 statemachines in it. And now I need another one to handle some protocol packet assembly and request/responses. I think instead of making another bad implementation I'd like to try and find something "more standard" that is either a design pattern with examples and comments, or a framework for this. There isn't a lot out there for C.I've found Quantum Leaps which is alright, and seems like it can be used in a way that lets me keep my existing code as is.Also uFSM was on hackernews the other day, but it's 11 days old, has no comments, and I'm not sure I can be on something that might be a timesuck.So.... What I'm looking for is a way to implement state charts, hierarchical would be nice, a clear manual transition table or a reliable automatically generated one, IDK.... What do you guys use?

author: obiwanjacobi
author_rank: Super Contributor
timestamp: June 17, 2018, 06:35:21 am
content: As discussedherethere are several options.I lean toward using code instead of tables or switch statements (directly).For that purpose I use a couple of macro's foundhere.You would write the statemachine as a sequence of code statements, using normal control flow (if/else/switch etc) and 'return' from the 'task' using one of the Task_Yield macros.These 'tasks' can be nested (use a C++ class for each task) and pretty complex, but still readable/understandable.Truth be told, I have never used it for more than 2 levels deep, though.

author: jnz
author_rank: Frequent Contributor
timestamp: June 20, 2018, 10:57:00 pm
content: That discussion was on machine yea, but I didn't see much about HSMs.Do you have a rough example of that code you linked to? I'm not exactly understanding some of it.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: June 21, 2018, 05:15:20 am
content: Here is an implementation of a task. TheTask_Begin(Execute)is the interesting bit.You can see you can use normal flow control to write out the logic. Here I'm using a while-loop.You would call it like this (Arduino).Here I instantiate 2 instances of the (counter) task and call them repeatedly in the main loop.You probably would not want to instantiate you statemachine more than once, though.Each sub-state in your hierarchical statemachine would be another task class where you write out its logic in the task-method (here Execute).Hope it helps.
Softlog ICP2 production programmers - Page 1
Forum section: electronics / general

author: jc101
author_rank: Frequent Contributor
timestamp: June 12, 2018, 01:25:31 pm
content: I've done a search which has come up blank, has anyone used the Softlog PIC programmers, specifically the ICP2(G3) unit?It looks like they do exactly what I want in that they are standalone, support serialisation, and cover 8, 16, and 32bit PICs. Pretty much a case of plug it in, press a button, and see if the pass or fail light comes on.
pickit 3 versus pickit 3.5 - Page 1
Forum section: electronics / general

author: 0xFFF0
author_rank: Regular Contributor
timestamp: June 11, 2018, 10:17:23 am
content: What are the differences between pickit 3 versus pickit 3.5

author: tsman
author_rank: Frequent Contributor
timestamp: June 11, 2018, 10:52:59 am
content: 3.5 isn't an official one by Microchip. Somebody has used the open design for the 3 andmade some changes.

author: 0xFFF0
author_rank: Regular Contributor
timestamp: June 11, 2018, 08:20:41 pm
content: Thanks for the link!
Driving a dot matrix LCD with a 16 bit MCU - Page 1
Forum section: electronics / general

author: daubmaso
author_rank: Contributor
timestamp: June 13, 2018, 04:19:21 pm
content: Hi, I am having a bit of trouble understanding how the commands would function on an LCD display I have my eye on. ie., what would the command sequence I load through the shift register to display a particular image be?For the sake of information I will be driving it with a PIC24f08KL302, or a dsPIC33EP128MC202. There's nothing special about them, just what I found on Digikey for cheap a while ago. (I also wanted to try out 16 bit MCU's)It's a 128x32p black and white LCD with an SPI interface.Product page:https://www.digikey.ca/product-detail/en/newhaven-display-intl/NHD-C12832A1Z-FSW-FBW-3V3/NHD-C12832A1Z-FSW-FBW-3V3-ND/2059236Datasheet:http://www.newhavendisplay.com/specs/NHD-C12832A1Z-FSW-FBW-3V3.pdfThanks in advance

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 13, 2018, 04:24:58 pm
content: You basically have to write to the internal display memory through "display data write" commands.The display controller is documented here:http://www.newhavendisplay.com/app_notes/ST7565R.pdf

author: daubmaso
author_rank: Contributor
timestamp: June 13, 2018, 05:09:22 pm
content: Okay, so from my understanding after reading this is that each page in the display ram corresponds to 8 rows in a certain position. When I go to write to the current page the column is then incremented over by one and the next write command corresponds to the same rows but the column over. Then after the last column I would reset the column position to 0 and start writing to the next page. Is that right or did I misread?

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 13, 2018, 07:49:52 pm
content: I think this should be it. Seems a bit unusual, kinda rotated by 90° compared to a lot of display drivers.I'm not sure whether you have to reset the column and increment the page after each page, but I think so. The spec doesn't mention the column wrapping around (it says it "tops" at 83h which is the last column, but doesn't say it wraps to 0...). As for the page, it doesn't state that the page is incremented automatically either.

author: daubmaso
author_rank: Contributor
timestamp: June 13, 2018, 08:07:13 pm
content: Well I guess I'll just have to play around with it and see.Thanks for your help!
how to program this programmable IC? - Page 1
Forum section: electronics / general

author: aurmer
author_rank: Regular Contributor
timestamp: June 11, 2018, 12:02:36 pm
content: This hall effect sensorsuits my needs, but as I scan thedatasheet, I am struggling to find specific information on how to program it.The documentation discusses all the wonderful options it has and even the values required to select these options. Can anyone help me understand what communication protocol this IC uses to receive programming data?Thanks

author: tsman
author_rank: Frequent Contributor
timestamp: June 11, 2018, 12:11:56 pm
content: You need theirPTC-04programmer unit and the correct daughterboard. The datasheet for your sensor mentions PTC Entry Level voltages of 5.8V - 6.6V so it looks like it uses its own proprietary protocol.Quote

author: aurmer
author_rank: Regular Contributor
timestamp: June 11, 2018, 12:14:17 pm
content: Their datasheet assumes the reader knows thatThanks.
Temperature sensor to interface with CPLDs - Page 1
Forum section: electronics / general

author: garvind25
author_rank: Regular Contributor
timestamp: June 09, 2018, 10:36:36 am
content: Hi,Can anyone suggest a simple SPI output based temperature sensor for interfacing with a CPLD. I am looking a hand solderable component which I can put on my CPLD based project and try interfacing with it. There are several sensors available on the internet but since I have never worked with these devices, I don’t know which to select.Thanks,Arvind Gupta

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 09, 2018, 12:25:06 pm
content: https://www.digikey.co.uk/products/en/sensors-transducers/temperature-sensors-analog-and-digital-output/518?k=temperature+sensor&k=&pkeyword=temperature+sensor&pv41=505&pv41=805&pv41=469&pv41=803&FV=ffe00206&quantity=0&ColumnSort=0&page=1&pageSize=25

author: NorthGuy
author_rank: Super Contributor
timestamp: June 09, 2018, 04:32:28 pm
content: DS18B20 are very popular for "normal" temperature range. Not exactly SPI, but it probably doesn't matter for CPLD.

author: garvind25
author_rank: Regular Contributor
timestamp: June 09, 2018, 04:55:33 pm
content: Thanks for the replies. Thermocouples and RTDs will be an expensive option for just trying to interface a temperature sensor to CPLD. I am looking for low cost options which are easily available. DS18B20 is a non SPI device. Will look into it later. As per the Digikey link, yes there a a lot of devices available but not on low cost sites like aliexpress etc. Hence, still looking for more answers pls.Thanks again,Arvind Gupta

author: dgtl
author_rank: Regular Contributor
timestamp: June 10, 2018, 04:35:37 pm
content: Unless there is a microcontroller somewhere, the 1-wire is not simple to write in hdl, requires a quite large state machine. Try to find some kind of SPI or I2C sensor, that does not require too much of configuration to use, something that would require only reading temperature register value.A CPLD is a bit strange choice for temperature sensor reading. A uc would be much more appropriate (unless there are some other parts of the system that would require CPLD).

author: NorthGuy
author_rank: Super Contributor
timestamp: June 10, 2018, 05:34:29 pm
content: Quote from: dgtl on June 10, 2018, 04:35:37 pmOne-wire is the same as SPI, except data and clock are multiplexed on the single wire.

author: andy1
author_rank: Contributor
timestamp: June 10, 2018, 06:17:52 pm
content: I would look into PWM-output temperature sensors, there are several manufacturers, they are usually quite cheap and the cpld/fpga part can be really simple to get the value.
Reading Coretx M4 EEPROM - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: June 14, 2018, 10:17:37 am
content: Hi,I have a MK10DX256LH7 device,It's from a 3rd party equipment, I have connected to my XELTEK 6100 programmer and was able to read the flash memory content, I want to know if it's possible to read the EEPROM with it too? or can I use J-link? Since I can not find any info regarding reading the EEPROM content in neither j-link nor XELETEK program.Any Ideas are welcome

author: wraper
author_rank: Unknown
timestamp: June 14, 2018, 10:20:44 am
content: Are you sure that both Flash and EEPROM content were not saved in a single file?

author: wraper
author_rank: Unknown
timestamp: June 14, 2018, 10:25:32 am
content: I briefly read a datasheet and apparently there is no EEPROM to begin with, only EEPROM emulation actually using Flash memory.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: June 14, 2018, 10:26:25 am
content: Thanks, I meant the 32KB flex Memory

author: wraper
author_rank: Unknown
timestamp: June 14, 2018, 10:30:37 am
content: Quote from: ali_asadzadeh on June 14, 2018, 10:26:25 amI'd assume it already should be in your dump file.
For PIC ADC Experts (2 channel sampling with isr) - Page 1
Forum section: electronics / general

author: 0xFFF0
author_rank: Regular Contributor
timestamp: June 07, 2018, 04:41:37 pm
content: Hi!I am a PIC greenhorn. Could someone with experience please help me here? I refer to this project from the microChip.http://microchipdeveloper.com/8bit:adcautoconvertIt is a sample program in which an ADC is triggered periodically by a timer and makes an interrupt after the conversion. Now I wonder how to do the same procedure if you want to work with 2 analog channels (or more). How do I set the other channel and how do I get the converted value into a 2nd variable? Can this work at all with the interrupt approach?P.S. I really want to do it with interrupt, because I do not want to wait for the conversion in the while loop.

author: StillTrying
author_rank: Super Contributor
timestamp: June 07, 2018, 04:54:18 pm
content: "How do I set the other channel and how do I get the converted value into a 2nd variable?"ASM ?Once the ADC is triggered just change to the other channel, next time around it will read the other channel.If you have only 2 alternating values, an easy way is just to keep incrementing a variable, when its bit0=0, you do one thing when its bit0=1, you do the other.

author: JPortici
author_rank: Super Contributor
timestamp: June 07, 2018, 04:58:25 pm
content: I don't know if you use any sort of libraries.I Don't. I work with registers.So, the curiosity board has a PIC16F1619 (which i never heard of, strangefrom that era i used PIC16F15xx,17xx,18xx and 19xx)The most current datasheet:http://ww1.microchip.com/downloads/en/DeviceDoc/40001770D.pdfREGISTER 17-1: ADCON0The Analog channel to be sampled is selected by the CHS field.Using C code, it's just a matter of writingCode:ADCON0bits.CHS = xxx;where xxx is the number of the channel (0 for AN0, 7 for AN7 and so on)Since your demo is using the auto sample / convert capability of the ADC module it's just a matter of adding this line, or, in other words, changing the channel, right afterCode:adc_result_t adval = ADC_GetConversionResult();Yes. There is a library function that does the same thing but i have no idea on how to call it, as i tend not to use libraries, esp on 8 bit PICs.You may notice that the sample rate -per channel- is now halved, as it's going to alternate between two channels.Will it work? Yes, in theory. In practice, unless the sample time is too short <-> the ADC source impedance is too high, you will have the expected result.
David L Jones mystic to the stars...ish - Page 1
Forum section: electronics / general

author: hackinblack
author_rank: Contributor
timestamp: June 07, 2018, 08:34:00 am
content: i found a posting on microchips forum from someone who saw the youtube 'april the first' spoof video (from way back in 2013!)mentioning the 'NEW PICKit 4' and confused it with fact. now the true psychic powers of the fabled mr Jones are revealed...this guy has a better hunch than quosimodo.
Bronze age arcade games on FPGA - Page 1
Forum section: electronics / general

author: james_s
author_rank: Super Contributor
timestamp: June 05, 2018, 12:34:08 am
content: I finally got around to consolidating and posting some projects I was working on a bit ago and posted the code. These are arcade games from the 70s which I have recreated in VHDL. All are targeted to the cheap and widely available EP2C5T144C8 "mini board" which is an older but still capable Cyclone II part. Everything fits entirely in the FPGA with only some resistors needed to mix the video signals and whatever controls you decide to use. Super Breakout I set up to use an optical quadrature encoder for the paddle knob but if you want you can duplicate the original comparator circuit to use a pot. The one snag that has caught some people is you need to either remove the unneeded 0-Ohm jumpers and RC circuit from the bottom of the mini board or re-assign some of the pins. I modified all my boards a while back to free up those otherwise wasted pins so I didn't even think about it at the time. I may swap the pins around myself and check in the change later as it's trivial to do. It should also be very easy to port this code to virtually any FPGA you want to use.I have limited time to provide support but if anyone has questions please post them here and I'll try to follow up. Manuals for all of these games can be found online and should help explain how to hook everything up. I'm releasing all of my VHDL as open source so feel free to modify and reuse it as you please. The original game ROMs these use are available from MAME sites.https://github.com/james10952001

author: NivagSwerdna
author_rank: Super Contributor
timestamp: June 05, 2018, 06:53:43 am
content: cool.Maybe you could contribute them intohttps://github.com/MiSTer-devel/Main_MiSTer/wiki?

author: obiwanjacobi
author_rank: Super Contributor
timestamp: June 05, 2018, 10:18:31 am
content: So you implement the digital hardware and the CPU in the FPGA and then run the original ROMs.Is that how it works?Nice

author: james_s
author_rank: Super Contributor
timestamp: June 05, 2018, 05:35:52 pm
content: Yes, exactly. The CPU is the open source T65 soft core 6502, the rest of the hardware is my code.For some reason Github seems to have mangled some of the formatting, I had everything nice and tidy.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 05, 2018, 06:25:27 pm
content: It's Microsoft's fault!
IoT hall of shame - Page 1
Forum section: electronics / general

author: Kjelt
author_rank: Super Contributor
timestamp: May 15, 2018, 07:05:57 am
content: Nice list of IoT devices that have security fails, some famous brands also.This is going to be a long webpagehttps://codecurmudgeon.com/wp/iot-hall-shame/

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 15, 2018, 05:00:23 pm
content: Great job compiling all of this!There are many funky security vulnerabilities. One I found particularly crunchy is the Fender amp one. Open Bluetooth audio streaming

author: MT
author_rank: Super Contributor
timestamp: May 25, 2018, 11:47:54 pm
content: NSA needs to know your G-dot! Who the hell needs to use a Iphone to controlVibratissimo Panty Buster.http://securityaffairs.co/wordpress/68778/iot/sex-toys-hacking.html

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 26, 2018, 03:15:16 pm
content: Quote from: Kjelt on May 15, 2018, 07:05:57 ami get this (attached) am i banned?

author: Kjelt
author_rank: Super Contributor
timestamp: May 26, 2018, 04:47:08 pm
content: FYI: That is NOT my site and I have no affiliation with it.

author: codecurmudgeon
author_rank: Newbie
timestamp: June 04, 2018, 04:10:10 pm
content: I'm not sure why you should get a 403 error - I'm not really setup that way. Sometimes the site is slow when I get bursts of traffic. Can you try again?
Cosmic Compiler for STM8, generating Hex - Page 1
Forum section: electronics / general

author: old gregg
author_rank: Regular Contributor
timestamp: June 02, 2018, 04:17:42 pm
content: I'm trying to use the Cosmic compiler with the STVD program (that keep crashing) from st micoelectronic. I want to create an hex file at the build process but I can't get the output adress path right . The content always end up in the console.the syntax goes"chex main.o -fi -o?", -fi being the command to convert to hex, but what do I put after the -o command ?I tried many things without success.

author: rstofer
author_rank: Super Contributor
timestamp: June 02, 2018, 04:46:30 pm
content: If it is like most *nix commands, -o <filename>.hexIf you can't get the output to go to a file, redirect it;chex {whatever} > {some file name}There's a handy redirection chart here:https://askubuntu.com/questions/420981/how-do-i-save-terminal-output-to-a-file

author: rstofer
author_rank: Super Contributor
timestamp: June 02, 2018, 09:51:45 pm
content: For most *nix programs, the -o file is named first<command> -o <output file> <input file>

author: old gregg
author_rank: Regular Contributor
timestamp: June 03, 2018, 01:48:49 pm
content: there's a subsitute for the path however "chex -o $(OutputPath)$(TargetSName).s19" but even with that, it doesn't work. I'll try the solution you give and report back.
Lattice Diamond: Simulation - Page 1
Forum section: electronics / general

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 29, 2018, 08:53:39 am
content: I installed Diamond for the first time and I'm about to branch out from blink...Does Diamond have simulation or is this something I need third party software to achieve? (I have Quartus II and this has simulation)What is the best free route to add simulation to Diamond? (Target is XO3)Thanks in advance

author: daveshah
author_rank: Unknown
timestamp: May 29, 2018, 01:49:27 pm
content: If you are on Windows, Lattice Diamond comes bundled with ActiveHDL Lattice Edition.If on Linux, Lattice Diamond does not have a simulator bundled. But you can use Icarus Verilog or Verilator (for Verilog), or ghdl (for VHDL) and point them to the Lattice simulation libraries. This way you will learn a free and platform independent simulator too.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: June 03, 2018, 11:08:13 am
content: Thanks. I went to the simulation wizard and it seems to work. Thanks!FWIW I found this a useful video...
ATMega32U4 Strange Looking Clock and MOSI Signals when doing ISP - Page 1
Forum section: electronics / general

author: bendras
author_rank: Contributor
timestamp: June 02, 2018, 12:04:34 pm
content: I am seeing strange signals when trying to program ATMega32U4 with an ISP programmer (https://www.sparkfun.com/products/9825to be more precise).Anybody has any ideas on what might be causing such a stepped signal?If I measure the clock signal which comes out of the ISP when its not connected to the ATMega32U4 board then it looks correct:

author: Rerouter
author_rank: Super Contributor
timestamp: June 02, 2018, 12:19:20 pm
content: Its defiantly not transmission line effects, At a guess its a contested pin, What else connects to that pin on your circuit?E.g. one device is pulling or driving high, and the other is trying to drive low.

author: Gibson486
author_rank: Frequent Contributor
timestamp: June 02, 2018, 02:22:08 pm
content: Looks like you have another output or input pulling it downOne cause could be multiple push pull outputs on the same line.

author: bendras
author_rank: Contributor
timestamp: June 02, 2018, 03:54:06 pm
content: Thank you for the tips. It turned out that the MOSI and CLOCK pins on the ATMega32U4 IC where accidentally shorted while soldering. After removing the solder bridge everything works as expected.
My first FPGA project - Page 1
Forum section: electronics / general

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 29, 2018, 09:01:36 am
content: I would like to achieve the following with my first FPGA project...The plan is to make a memory checksum gadget to work with 6809E motherboards (although the processor will hopefully not be a constraint)...So... I'm planning to use a FPGA (possibly Lattice MachXO3) with voltage level translation. The problem is reasonably simple... I drive a bus (16 lines), reading another bus (8 lines).Interacting with the FPGA will be some form of 'driver' microprocessor (Rpi, Arduino, ESP32 etc), the driver will instruct the FPGA to do the scan and then wait and collect the result.As time goes on I will add extra functions (e.g. write to address, read single address etc) and take account of bus arbitration with DRAM on DUT etc.What would people recommend for the driver to FPGA interface? I2C? I need a certain amount of logic on the FPGA but should I do that as a FSM or use a free processor core?Any pointers please?Also... Ideally I would like DUT operations to be driven by a clock derived from the DUT clock (approx 4MHz)... but that's possibly a different challengeThanks in advance

author: Berni
author_rank: Super Contributor
timestamp: May 29, 2018, 09:18:58 am
content: Nice applocation for a FPGA.You dont need a softcore if you have a external MCU. For the interface you want SPI as its fast and needs verry little logic to implement