hybridfree/eevblog-posts huggingface dataset:
Announce: SushiBits ARM Classic development kit - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: August 26, 2018, 07:43:16 pm
content: This is a fresh design centered around the NXP LPC2103, an older chip with ARM7 core. All but two GPIO pins are brought out. The two remaining GPIO pins, the second I2C interface, is connected to an I2C EEPROM chip as onboard data EEPROM. On the board there is a USB microcontroller, STM32F042F4, as the USB to serial adapter that also understands Arduino-style DTR and 1200-baud pings, used as "system reset" and "reboot to bootloader" commands.I built this board with the intention as a learning tool for classic ARM architecture bare-metal programming. The board also toys with the idea of using 16MHz ceramic resonators as the clock source for various chips, up to and including the USB chip. (The STM32F042 supports running USB synchronized to the SOF frames, allowing even crystal-less operation in the worst case scenario, so even in the case that the resonator isn't good enough for the USB I still has a "get out of jail free" card on this.) I almost went with a MP2122 as the platform PMIC that emits 3.3V Vdd and 1.8V Vcore at the same time using its two output phases, but decided to go with the conventional switch-mode converter from 5V to 3.3V and then a linear regulator for the 1.8V Vcore power delivery design. The multi-rail power supply for those microcontroller chips are surely annoying, requiring additional external circuitry to power.Here is the board itself:Here is the board next to Arduino Zero:
pickit4 xc8 and 16f628A and nothing happens. - Page 1
Forum section: electronics / general

author: matise
author_rank: Contributor
timestamp: August 13, 2018, 01:31:13 pm
content: Hi.Can someone give me a hint?im programming this pic16f628A and build and make works fine.(pickit 4)it says its all succesfull.But that darn led just dont blink.ive tried, like you see in my code, even simplier to just give RB5 5v and no delays.Nothing.ive tried another pic but nothing.What am i missing?I know i connect it right + - and RB5 out to led.i have tested led and it works...hmmm, i cant see anything wrong.#include <pic16f628A.h>#include <xc.h>#pragma config FOSC = INTOSCIO#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT enabled)#pragma config PWRTE = OFF#pragma config MCLRE = ON // RA5/MCLR/VPP Pin Function Select bit (RA5/MCLR/VPP pin function is MCLR)#pragma config BOREN = ON // Brown-out Detect Enable bit (BOD enabled)#pragma config LVP = OFF // Low-Voltage Programming Enable bit (RB4/PGM pin has PGM function, low-voltage programming enabled)#pragma config CPD = OFF // Data EE Memory Code Protection bit (Data memory code protection off)#pragma config CP = OFF#define _XTAL_FREQ 4000000/***/int main(int argc, char** argv){TRISB = 0b00000000;while(1){PORTBbits.RB5 = 1;//__delay_ms(500);//PORTBbits.RB5 = 0;//__delay_ms(500);}return 0;}

author: JPortici
author_rank: Super Contributor
timestamp: August 13, 2018, 03:10:59 pm
content: Please, use code tags next timeI seem to remember that there are issues with IPE and probably also the IDE and some tools, where MCLR is not de-asserted after programming. You could try removing the MCLR connection after you program the picQuotejust useCode:void main()

author: matise
author_rank: Contributor
timestamp: August 14, 2018, 12:29:51 pm
content: yes, it seems to be something with MCLR.Thing are going in right direction.tnx!

author: towlerg
author_rank: Contributor
timestamp: August 15, 2018, 12:20:46 pm
content: As you're not using LVP, you can turn MCLRE off.

author: technix
author_rank: Super Contributor
timestamp: August 25, 2018, 03:41:01 am
content: Quote from: JPortici on August 13, 2018, 03:10:59 pmWhileCode:int main(int argc, char** argv)is excessive for microcontrollers, if you usedCode:void main()you will get yelled at by some compilers. The compromise should be:Code:int main(void)which is appropriate for this purpose and won't get you unwanted warnings.

author: stj
author_rank: Super Contributor
timestamp: August 25, 2018, 11:11:38 am
content: put a pullup resistor on MCLR.my first pic circuit was unstable till i realised it had no internal pullup and was constantly resetting.
Laws for Using Microchip Parts - Page 1
Forum section: electronics / general

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 24, 2018, 12:16:01 am
content: From irc.afternet.org #eevblog:Quote[The last one is misattributed but I'll give credit this way.]Tim

author: D3f1ant
author_rank: Frequent Contributor
timestamp: August 26, 2018, 02:15:25 am
content: Its 2018...why can't errata be merged/corrected in the datasheet. Hate trolling through errata.

author: Nominal Animal
author_rank: Super Contributor
timestamp: August 26, 2018, 12:36:21 pm
content: Quote from: D3f1ant on August 26, 2018, 02:15:25 amWhy don't you quit, then? I don't think any pay would be worth writing deliberately misleading errata.Unless you meanttrawling, of course.
7-seg LED representation - Page 1
Forum section: electronics / general

author: PerranOak
author_rank: Frequent Contributor
timestamp: August 19, 2018, 02:00:04 pm
content: So, I have the working project with its 7-seg LEDs. How do I represent/print/display (I can't even think what to call it!) the various outputs in the user instructions?I want the instructions to show exactly what the display will look like especially when representing characters that are not obvious, e.g. "X"!Cheers.

author: rstofer
author_rank: Super Contributor
timestamp: August 19, 2018, 02:19:04 pm
content: Are you looking for 7 segment fonts to use with some publishing program? Google shows it is possible to add fonts to programs like Word.

author: PerranOak
author_rank: Frequent Contributor
timestamp: August 19, 2018, 05:06:47 pm
content: That's a good idea thanks but they all use their own "alphabet" which is not the same as mine (e.g. they use "H" as an "X" whereas I use three horizontal lines for "X". Also, I'm not sure of the security situation as regards font downloading/installing.I wondered if there was a way to do it using pictures or something?

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: August 19, 2018, 07:51:06 pm
content: Quote from: PerranOak on August 19, 2018, 05:06:47 pmOf course there is. Draw the picture then paste into the document.

author: james_s
author_rank: Super Contributor
timestamp: August 20, 2018, 12:35:17 am
content: Draw a picture of hollow segments, save that as a blank "unlit" digit. Fill the desired segments with a solid color to make them "lit" segments. Without a better description of what you're trying to achieve that's about the best I can do.I suppose another option is to wire up a 7 segment display and take pictures of it.

author: drojf
author_rank: Newbie
timestamp: August 20, 2018, 01:06:17 am
content: I think you'll find this website very useful. It's a screenshot generator for 7seg / 14seg / 16seg / grid displays:http://avtanski.net/projects/lcd/(I'm not sure you can represent nonstandard characters though (like...all the digits of the display lit), only the 'normal' ones)

author: PerranOak
author_rank: Frequent Contributor
timestamp: August 21, 2018, 08:41:23 am
content: Thank you for the replies.

author: kcozens
author_rank: Contributor
timestamp: August 21, 2018, 02:51:38 pm
content: Do a search for "7 segment display alphabet" and you will find lots of images/information showing how to represent letters, numbers, and punctuation in just 7 segments.

author: PerranOak
author_rank: Frequent Contributor
timestamp: August 23, 2018, 03:05:15 pm
content: Cheers. I did that and now use a drawing app to in-fill the required segments. Beauty!
stm32 HAL SPI with DMA - Page 1
Forum section: electronics / general

author: sortovaritu
author_rank: Newbie
timestamp: August 21, 2018, 08:13:45 pm
content: Is it possible to use HAL_SPI_Transmit together with HAL_SPI_Transmit_DMA??For example:HAL_SPI_Transmit(SPI2, arr_1, 0x04, 1);HAL_SPI_Transmit_DMA(SPI2, arr_2 , 0x04);My issue that the second command(HAL_SPI_Transmit_DMA(SPI2, arr_2 , 0x04)does not send any data to SPI

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 22, 2018, 06:15:13 pm
content: You may want to check the error codes returned by those two functions, that may help.

author: newbrain
author_rank: Super Contributor
timestamp: August 22, 2018, 06:54:04 pm
content: It's definitely possible.Of course, the transmission from one call must be completed before the other one (or the same!) can be invoked.If not, the HAL will return an error (HAL_BUSY).The DMA setup might be wrong, can you show us your code?

author: Berni
author_rank: Super Contributor
timestamp: August 22, 2018, 07:00:01 pm
content: You often need to set up the DMA separately for things to work, could need certain interrupts set up and there might be other limitations with what memory areas the DMA can access. If any of it goes wrong you might get a hard fault, nothing happening or the driver becoming confused.You most definitely have to watch out when using both that the DMA is done with its work before you try to do anything else. There are functions you can call to find out or check the contents of the SPI driver struct.And sometimes the HAL just doesn't do exactly what you want, in that case you can sometimes copy paste an existing HAL function and modify it so that it works in the way you want.

author: sortovaritu
author_rank: Newbie
timestamp: August 23, 2018, 07:26:00 am
content: I found a Solution:DMA should be initiated before SPI initiation.
[ATmega 0] - because I am not flipping clairvoyant input captures pins?  - Page 1
Forum section: electronics / general

author: Simon
author_rank: Unknown
timestamp: August 20, 2018, 11:20:25 am
content: I have found no reference in the datasheets about which pins are the inputs for timer events. Any clues? I see EVOUT pins but I need event IN pins or are these it?

author: andersm
author_rank: Super Contributor
timestamp: August 20, 2018, 11:41:20 am
content: There's no dedicated timer input pin, instead there's a more general event system. In your case you'd need to configure your wanted pin as an event generator for one of the event channels, and then connect one of the timer's event inputs to that channel. Or at least that's what I surmised by looking at the hardware manual for a few minutes.

author: Simon
author_rank: Unknown
timestamp: August 20, 2018, 11:52:27 am
content: OK, pity that its not mentioned in the counters section, there are 486 pages to this thing.
STM32L0 RTC doesn't increment. - Page 1
Forum section: electronics / general

author: Boscoe
author_rank: Frequent Contributor
timestamp: August 15, 2018, 05:32:58 pm
content: Hi all,I wonder if someone could shed some light on this and help me out maybe.I've setup the RTC in Cube with a wakeup from sleep mode. This wakeup does work at the 5 second interval that I have set so the RTC is running.The problem I have is when I read the time. I read the time then the date as just reading the time freezes the result. The values I read never change from 0:32:0, it doesn't matter what I initialise the time or date to. Does anyone know what I could be doing wrong?ThanksWhen I get the time:Code:void RTCGetTime(RTC_TimeTypeDef * sTime, RTC_DateTypeDef * sDate){// Get the time and dateHAL_RTC_GetTime(&hrtc, sTime, RTC_FORMAT_BIN);HAL_RTC_GetDate(&hrtc, sDate, RTC_FORMAT_BIN);}And the init:Code:void MX_RTC_Init(void){RTC_TimeTypeDef sTime;RTC_DateTypeDef sDate;/**Initialize RTC Only*/hrtc.Instance = RTC;hrtc.Init.HourFormat = RTC_HOURFORMAT_24;hrtc.Init.AsynchPrediv = 127;hrtc.Init.SynchPrediv = 255;hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;if (HAL_RTC_Init(&hrtc) != HAL_OK){_Error_Handler(__FILE__, __LINE__);}/**Initialize RTC and set the Time and Date*/if(HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR0) != 0x32F2){sTime.Hours = 0x0;sTime.Minutes = 0x30;sTime.Seconds = 0x0;sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;sTime.StoreOperation = RTC_STOREOPERATION_RESET;if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK){_Error_Handler(__FILE__, __LINE__);}sDate.WeekDay = RTC_WEEKDAY_MONDAY;sDate.Month = RTC_MONTH_JANUARY;sDate.Date = 0x1;sDate.Year = 0x0;if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK){_Error_Handler(__FILE__, __LINE__);}HAL_RTCEx_BKUPWrite(&hrtc,RTC_BKP_DR0,0x32F2);}/**Enable the WakeUp*/if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 5, RTC_WAKEUPCLOCK_CK_SPRE_16BITS) != HAL_OK){_Error_Handler(__FILE__, __LINE__);}}

author: mikerj
author_rank: Super Contributor
timestamp: August 15, 2018, 05:56:15 pm
content: Seems to be aknown problem. According to that link ST know about it and say it's a "feature" that you must always read date after time.

author: Boscoe
author_rank: Frequent Contributor
timestamp: August 15, 2018, 07:36:22 pm
content: Quote from: mikerj on August 15, 2018, 05:56:15 pmThanks, bit I did. But still doesn't work.I ended up just making my own driver in the end.
Edit interal EEPROM values of 16F876 PIC with CODE PROTECT - Page 1
Forum section: electronics / general

author: Axxel
author_rank: Contributor
timestamp: August 15, 2018, 03:50:48 am
content: Hi freinds!Is there any way to edit or reprogram ONLY the internal EEPROM content of a PIC in CODE-PROTECT mode without damaging the existent program? Or replace the content of the EEPROM values to FF FF FF FF content? Keeping the loaded program?Regards

author: MarkF
author_rank: Super Contributor
timestamp: August 15, 2018, 05:07:17 am
content: Here's some code I have for a pic16f877a to read/write a byte. Never had a reason to use it, so I don't know if it works.Code:// EEPROM Read token...// buffer == address// buffer == datacase FT_EEPROM_READ:EEADR=buffer; // EEPROM addressEECON1bits.EEPGD=0; // EEPROM data memoryEECON1bits.RD=1; // Initiate readbuffer=EEDATA; // EEPROM dataSendPacket(3);break;// EEPROM Write token...// buffer == address// buffer == datacase FT_EEPROM_WRITE:EEADR=buffer; // EEPROM addressEEDATA=buffer; // EEPROM dataEECON1bits.EEPGD=0; // EEPROM data memoryEECON1bits.WREN=1; // EEPROM write enableintrbyte=INTCON;INTCON=0; // Disable interruptsEECON2=0x55;EECON2=0xAA;EECON1bits.WR=1; // Initiate writeINTCON=intrbyte; // Restore interrupt statewhile (EECON1bits.WR); // Wait for write to completeEECON1bits.WREN=0; // EEPROM write inhibitbreak;

author: Ian.M
author_rank: Super Contributor
timestamp: August 15, 2018, 06:08:53 am
content: If the CPD bit in the CONFIG word is zero, then the EEPROM is protected and you are S.O.L.If its set (its default state after chip erase), the EEPROM can be both read and written by any programmer + programming utility that can be configured to not do a chip erase, and only write the EEPROM memory range. Setting this up depends on your programmer, and it would be advisable to practice on a new PIC16F876 to confirm you can write to the EEPROM without disturbing the program memory or CONFIG word.Even if the chip is fully protected, the bits in the CONFIG word can be read back, so you can simply read the chip then examine the CPD bit and the values returned for the EEPROM area to determine if its possible.

author: Axxel
author_rank: Contributor
timestamp: August 15, 2018, 06:42:56 pm
content: Thanks dude for the answer!Quote from: Ian.M on August 15, 2018, 06:08:53 amI have a PicKit2, i've done it!Just unchek program memory and check EEPROM Data!As simple as it! Of coure you need having the corrects fuses...
Plugging Atmel ICE into legacy board? - Page 1
Forum section: electronics / general

author: vini_i
author_rank: Regular Contributor
timestamp: August 14, 2018, 03:41:15 pm
content: I need to plug an Atmel ICE into a legacy board that has a 10 pin ISP programming header on it.The little adapter board that comes with the ICE converts the cable to a 10 pin JTAG connector that does not match the ISP pinout.From everything that I've searched, I can find 10 pin male to 6 pin female everywhere.I can't seem to find any 10 pin female to 6 pin male adapters.Any thoughts on how to plug these in? I can make my own board but it seems like something should be available.

author: ataradov
author_rank: Super Contributor
timestamp: August 14, 2018, 04:52:49 pm
content: There is no good way. The only option you have normally is 6-pin connector. But Atmel-ICE comes with a cable that just has 10 floating 0.1" connectors, you can use that to assemble any connector configuration you like. It is not easy to unplug and re-plug this assembly, so if you need to use it a lot, then you will have to make an adapter.

author: vini_i
author_rank: Regular Contributor
timestamp: August 14, 2018, 06:06:08 pm
content: I was afraid you would say that. The couple of units that I needed to get done, I did with the cable you mentioned but it's not a long-term solution. I guess I'll have to make a board.

author: ataradov
author_rank: Super Contributor
timestamp: August 14, 2018, 06:09:29 pm
content: It does not have to be anything fancy, you can do it from a couple connectors and a protoboard. You can still use that squid cable, but connect it to a temporary adapter.I have lots of boards like this for custom programming connector layouts.

author: ebclr
author_rank: Super Contributor
timestamp: August 15, 2018, 09:41:01 am
content: If you can buy from China, this will help youhttps://item.taobao.com/item.htm?spm=a230r.1.14.32.16e47886hchemH&id=536473612667&ns=1&abbucket=18#detail
touchgfx Acquired by ST - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: August 18, 2018, 01:13:14 pm
content: Hi,So does it come free for ST parts? also what happens to other Cortex devices from other suppliers, like the i.MXRT series from NXPAny Ideas? should we expect it to get the source code? and port it to other parts!?
Atmel Studio opens .cpp & .c files in notepad - Page 1
Forum section: electronics / general

author: AjayS
author_rank: Newbie
timestamp: August 16, 2018, 01:38:40 pm
content: My Atmel studio has been acting weird since last week. It is not opening my previous project's C file. I get an error when I open the Atmel Studio (which I was getting since day one but it wasn't any kind of an issue. I could still open my projects). I reinstalled it twice; deleting all the files or anything that was related to Atmel Studio but it stills does the same thing

author: mikerj
author_rank: Super Contributor
timestamp: August 16, 2018, 02:57:25 pm
content: Have you tried'Reset Your Settings'?
I2C to Wifi or UART for ESP32 - Page 1
Forum section: electronics / general

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 07, 2018, 12:40:13 am
content: I have a device containing an ESP32 (acting as I2C master), a PIC acting as an I2C slave, and a bunch of other I2C slaves. For debugging and development purposes, I would like a way to run something on the ESP32 that allows I2C communications to be controlled over Wifi or UART, to allow testing using Python scripts on a PC.Is there any existing code to do just that? I would prefer not having to make that from scratch if possible.

author: Quarlo Klobrigney
author_rank: Super Contributor
timestamp: August 14, 2018, 03:32:13 pm
content: Have you seen this fellow's page yet? Lots of examples of the ESP here.You may not find it exactly, but it may give you ideas.Andreas Spiess - YouTube
Cyclone 10CL016 on Arduino MKR? - Page 1
Forum section: electronics / general

author: awallin
author_rank: Frequent Contributor
timestamp: August 14, 2018, 08:37:50 am
content: From time to time I have this urge to start on an FPGA project ... usually I just wait for the urge to go awayCan anyone comment on the usefulness/wow-factor of the Cyclone 10CL016 included on the Arduino MKR 4000:https://store.arduino.cc/arduino-vidor-4000is that FPGA big enough for hobby and/or serious designs that are out there and built for e.g. Xilinx spartan3 or spartan6? Is it straightforward to take VHDL for Xilinx spartan and us it for Cyclone?thanks!AW

author: iMo
author_rank: Super Contributor
timestamp: August 14, 2018, 12:42:27 pm
content: QuoteThat FPGA with 16k LEs, 504kB ram, 56 multipliers, 4 plls is well prepared for almost any hobby design, imho (.. it always depends what you want to design, of course..)PS: Intel Cyclone and Microchip ATSAMD.. Weird
AVR CAN controller: what does this wierd phrasing in a datasheet note mean? - Page 1
Forum section: electronics / general

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 13, 2018, 12:01:26 am
content: I am presently writing some code that uses the CAN controller on an ATmega32M1. I want to put the CAN controller into standby mode whenever I put the micro as a whole to sleep, and put the CAN controller back to enabled when the micro resumes.In the datasheet, I'm reading the documentation describing theCANGCONregister that has theENASTBflag. When describing putting the CAN controller into standby mode, it has the following note, but the language used there is very poor and makes no sense at all to me.QuoteWhat the hell do they mean by "wait for a lake"?!As a native Englishman, the word 'lake' has only one meaning to me: a large body of water entirely encompassed by land!If I had to guess, I'd say the quoted excerpt above was written by a non-native English speaker, who may have had some native idiom in mind that didn't translate well. What could they have meant?

author: sleemanj
author_rank: Super Contributor
timestamp: August 13, 2018, 12:31:21 am
content: Maybe it is a bad translation of (does unicode work here yet...) 薮 which Google Translate isn't sure about in the Chinese->English direction but includes as noun "lake" and as verb "find, look for, search"So, "wait for a lake" probably means "wait until you find "RXBSY".Well that's my best guess.

author: saike
author_rank: Regular Contributor
timestamp: August 13, 2018, 08:26:34 am
content: Looks to me like it should be "wait for alackof a receiver busy"

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 13, 2018, 04:43:14 pm
content: Ah, yes, I think you're right! It hadn't occurred to me that they were going for a word thatsoundssimilar.Waiting for RXBSY to clear (i.e. 'lack' of flag being a zero) makes sense, and I was kinda coming to that conclusion myself after turning things over and over in my mind since yesterday.

author: jnz
author_rank: Frequent Contributor
timestamp: August 13, 2018, 06:13:01 pm
content: Quote from: saike on August 13, 2018, 08:26:34 amProbably.LOTS of CAN modules work like this. They can't actively switch modes while "the line is high" so you need to keep trying to set the mode in a loop or get creative when you know it's going to be recessive. Loop is the most common.//set configmode = normal;while (mode!=normal);//move alongThe difference here is they are telling you a loop might need some extra conditions to get you out of it if you happen to enter at the wrong time.
Vertical movement sensor - Page 1
Forum section: electronics / general

author: lukebarber
author_rank: Newbie
timestamp: August 09, 2018, 10:29:02 pm
content: Hi,I am wondering if anyone knows a sensor that only detects a vertical up and down movement?I came across a sensor that could work for my application but it's very expensive.https://www.clrwtr.com/Products/B2N60H-Q20L60-2LI2-H1151I thought of using a single axis accelerometer but the sensor will be rotating in my application. I tried using an altimeter/pressure sensor; but it was too sensitive to interference from local airflow near the sensor.The location is not fixed. I may have to get a 3DOF or 9DOF IMU and read out only one of the axes. I'm not sure if it would work either.Any suggestions would be greatly appreciated.

author: tpowell1830
author_rank: Frequent Contributor
timestamp: August 10, 2018, 07:09:00 am
content: You may have noticed that this has been read many times without a response. The reason that I can't respond is because I need to know more about what you are trying to accomplish. You have presented your solution to something that no one else can see the problem.Welcome to the forum.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: August 10, 2018, 09:08:39 am
content: 3-axis acccelerometer, because that's what everyone makes.Ignore 2 of the axes.

author: IDEngineer
author_rank: Super Contributor
timestamp: August 12, 2018, 05:51:21 pm
content: Having designed 3-axis accelerometer and inclinometer modules for a variety of applications, I can tell you that the most straightforward and mechanically reliable approach will be to use a 3-axis accelerometer. Detect the 1G gravity vector, then watch for changes along that vector to indicate vertical motion. I presume it is unlikely that you can keep the sensor perfectly orthogonal to gravity, so you cannot ignore the "other two axes"... you will need to do 3D coordinate rotations and some filtering to differentiate between orientation changes and actual vertical movement.None of this is overly difficult, and will yield a sensor with no moving parts (other than the internal MEMS element) that requires no maintenance.
ultrasonic sensor using vhdl - Page 1
Forum section: electronics / general

author: swampythe47
author_rank: Newbie
timestamp: August 15, 2018, 09:43:32 am
content: I am a vhdl beginner and i want to interface an ultrasonic sensor on fpga board using vhdl. Can someone please help me how can i do it?

author: FlyingDutch
author_rank: Regular Contributor
timestamp: August 15, 2018, 10:13:27 am
content: Hello,here you have few examples:https://www.pantechsolutions.net/fpga-projects/fpga-implementation-of-distance-measurement-with-ultrasonic-sensorhttps://forums.intel.com/s/question/0D50P00003yyS6ESAU/ultrasonic-sensor-hcsr04-vhdl-code?language=en_USBasically the designs are based of measuring the time of sound echo.Regards

author: swampythe47
author_rank: Newbie
timestamp: August 15, 2018, 10:16:38 am
content: the code in video is not working

author: FlyingDutch
author_rank: Regular Contributor
timestamp: August 15, 2018, 10:24:33 am
content: Hello,first of all:1) What FPGA board are you using?2) What software for syntesis are you using?3) What errors you have?4) Show code of your projectI am assuming that you are aware of fact that "user constraint file - ucf, xdc" for used FPGA ICs is needed (someone have to modify/create it for particular FPGA board).Regards

author: swampythe47
author_rank: Newbie
timestamp: August 15, 2018, 10:26:30 am
content: I am using altera de1 board. There are no errors but the value doesnt change

author: emece67
author_rank: Frequent Contributor
timestamp: August 15, 2018, 10:29:23 am
content: .

author: FlyingDutch
author_rank: Regular Contributor
timestamp: August 15, 2018, 10:36:31 am
content: Hi,without seeing code I am not able to help you (show your project code). Crucial is also schematic showing how you attache the sensor to FPGA board (or photo). From what source do you powering you sensor? What is sensor type (model) - some have 5 Volt logic levels , in such case you need level converters.Regards

author: emece67
author_rank: Frequent Contributor
timestamp: August 15, 2018, 10:45:59 am
content: .

author: hamster_nz
author_rank: Super Contributor
timestamp: August 15, 2018, 10:49:45 am
content: From back in November 2014.... (been published openly for a while, so isn't doing anybody's homework for them, other than maybe saving them from using Google)http://hamsterworks.co.nz/mediawiki/index.php/SonarIt works as described - ultrasonic sensor interfaced to FPGA displaying distance in cm on the 7-segment display.Most of it is quite indirect - what is going on isn't going to be immediately obvious, especially to a beginner.Free free to ask questions - but make them good questions!Not "how does it work?" but "Where does the value '2900*2-1' come from?"
Lattice PLL settings - Page 1
Forum section: electronics / general

author: Dajgoro
author_rank: Frequent Contributor
timestamp: August 11, 2018, 05:32:32 pm
content: Hi,I'm trying to get the PLL in the XO2 - 7000 working properly, but I'm having some odd issues.On page 24:http://www.latticesemi.com/~/media/LatticeSemi/Documents/ApplicationNotes/MO/MachXO2sysCLOCKPLLDesignandUsageGuide.pdf?document_id=39080It is shown the PLL config window, and whatever settings I type in there the frequency I get out is about 10x less than what the dialog shows.So if I set 100 and if it says "actual frequency" to be 100 as well, I see 10Hz on my scope. What could be causing this.The PLL pins are directly mapped to the output pins, there is no other HDL code.

author: iMo
author_rank: Super Contributor
timestamp: August 11, 2018, 08:33:14 pm
content: What is your CLKI frequency?

author: Dajgoro
author_rank: Frequent Contributor
timestamp: August 11, 2018, 08:45:23 pm
content: QuoteI'm actually not sure, I did not set any settings for it, so it must be some sort of default value.How do I access the settings for the CLKI?

author: iMo
author_rank: Super Contributor
timestamp: August 11, 2018, 09:13:57 pm
content: CLKI is the input clock you feed a PLL module with, such you get a CLKOP out of it.PLL module only multiplies the CLKI by X.You have to connect an external oscillator (3.3V level) to the CLKI, or use an internal clock source, if any, and connect it to the CLKI.In the configurator you have to input the actual CLKI frequency, for example 20MHz.

author: Dajgoro
author_rank: Frequent Contributor
timestamp: August 11, 2018, 09:37:53 pm
content: If I did not connect any input clock, why is it working at all.I will look into that, try to give it a proper clock source.Also why at certain frequencies some division ratios are not possible, for example divide by 15 only works at less than 60?

author: iMo
author_rank: Super Contributor
timestamp: August 12, 2018, 08:31:04 am
content: Best is to read the app notes..
fpga: most area-efficient way to filter & decimate a signal? - Page 1
Forum section: electronics / general

author: mrf184
author_rank: Contributor
timestamp: August 13, 2018, 05:48:49 pm
content: I want to demodulate all the FM stations simultaneously using an FPGA and SDR. For this I need to implement around 10 receivers each tuned to a different frequency.The baseband signal coming in will be 20MSPS I and Q and will include all the stations.In each receiver, the baseband signal is multiplied by the complex sinusoid to shift the desired channel to 0Hz. This will already take up all the multipliers in the FPGA, so any filtering afterwards can not use hardware multipliers. After the multiplication I need to filter and decimate the signal to +/-80kHz bandwidth and sample rate around 400ksps.Normally I would use the polyphase convolution for something like this, since the decimation factor is high (50), but to do so a hard multiplier is needed since we aren't multiplying by constants anymore (the whole point of polyphase fir is so that you don't need a multiplier for every coefficient, which means the multipliers now are dealing with dynamic coefficients read from a rom). There aren't enough hardware multipliers remaining so this is ruled out.Cascading many direct form FIR filters (each filter decimates by 2) helps somewhat, but since a sharp rolloff is needed the final filter still has to be of fairly high order (~64), which would consume quite some area. The filter should be as small as possible so the maximum number of receivers can be put in the FPGA.IIR filters also seem a good option, but I'm not sure if the nonlinear phase over frequency will cause noticeable distortion with FM?There are 16 total multipliers in the FPGA, but the frequency shifter requires complex multiplications so will take 4 multipliers. The multiplier will have to be multiplexed between the 10 receivers (using shift registers), so the multiplier will be running at 200MHz. The 12 remaining multipliers can implement 6 complex-valued polyphase filters, not quite enough.

author: hamster_nz
author_rank: Super Contributor
timestamp: August 13, 2018, 07:24:29 pm
content: Run at 200MHz and reuse the resouces ten tiimes.You may need to decimate and filter in two stages. Once using a short parallel filter, and then a second time using a serial filter, now that there are more cycles per sample.

author: langwadt
author_rank: Super Contributor
timestamp: August 13, 2018, 07:59:55 pm
content: https://en.wikipedia.org/wiki/Cascaded_integrator%E2%80%93comb_filter

author: ataradov
author_rank: Super Contributor
timestamp: August 13, 2018, 08:09:38 pm
content: CIC is definitely the way to go. With optional short pre-emphasis FIR filter.

author: kony
author_rank: Regular Contributor
timestamp: August 14, 2018, 08:34:36 pm
content: Yeah, CIC decimation filter. No MAC needed, just adders. Just be aware of the baseband aliasing.
problem with Stm32f103 SPI transceiver!  - Page 1
Forum section: electronics / general

author: javad2040
author_rank: Contributor
timestamp: August 09, 2018, 12:53:22 pm
content: hello guys.I designed an board that contain ADC128S022 acd and STM32F103RBT6 mcu. The interface between them is SPI and i used stm32cube to config the MUC and SPI protocol.This ADC has 8 channel that user can select one of them to capture the input Data. Also this ADC has one register that can be configured by receiving one byte control data according below figure (SPI and config register timing).For config the ADC and capture the Data from channels, i use stm32cube tools and set the SPI parameters to:APB1 clock = 8MhzData Size = 16bitPrescaler = 4Baud Rate = 1 Kbit/sCPOL = lowCPHA = 1 edgeandADC frecuency (fsclk) = 0.8 to 3.2 MHzADC sample Rate = 50 to 200 KSPSI set the CS as GPIO and Output (Software CS) and in my code before send or receive command, it be activated.I write this function to config the ADC and capture the Data, but the Received data has always 1 (11...1111) and can not recognize the problem(s).Code:uint16_t ADC_Capture(uint8_t N){uint16_t Tx_data=;uint16_t Rx_data={0};uint16_t Received_Data;ADC_CS_Bar_0;HAL_Delay(10);switch(N){case 1 :Tx_data=0;break;case 2 :Tx_data=8;break;case 3 :Tx_data=16;break;case 4 :Tx_data=24;break;case 5 :Tx_data=32;break;case 6 :Tx_data=40;break;case 7 :Tx_data=48;break;case 8 :Tx_data=56;break;default :break;}HAL_SPI_TransmitReceive(&hspi2,(uint8_t *)Tx_data,(uint8_t *)Rx_data,1,100);Received_Data = Rx_data;Received_Data &= 0x0FFF;ADC_CS_Bar_1;HAL_Delay(10);return Received_Data;}Please help me to solve this problem!Regards,

author: mbless
author_rank: Regular Contributor
timestamp: August 09, 2018, 02:35:11 pm
content: 1. Have you looked at it on a scope?2. Based on the timing diagram, it looks like CPOL is high and sampling is done on the 2nd edge.

author: newbrain
author_rank: Super Contributor
timestamp: August 09, 2018, 07:32:46 pm
content: Quote from: mbless on August 09, 2018, 02:35:11 pmThis, plus a further question: How are ADC_CS_Bar_0 and _1 defined?If they are "real" functions, you are not actually calling them (just taking their address and discarding it).If, instead, they are function-like preprocessor macros it would be better to make them look like like real functions, for clarity.The 10ms delay between /CS falling and start of SPI clock might be excessive, though the data sheet does not state a maximum for tCSS(but the minumum is greater than the nominal...)Furthermore, I imagine the "1 kb/s" is actually 1000kb/s, given the other definitions?

author: javad2040
author_rank: Contributor
timestamp: August 12, 2018, 07:00:53 am
content: thank you for reply.Quoteyes i defined the ADC_CS_Bar_0 and _1 variable and in STM32Cube all parameters of SPi is set correctly.By checking the ADC and code, i noticed that the problem is related to ADC hardware and my code is correct. By changing the ADC, i can receive data form all ADC channels and then save them.thanks for all.
FFT on STM32 CMSIS library outputs Nan (Not a number) - Page 1
Forum section: electronics / general

author: DG41WV
author_rank: Regular Contributor
timestamp: August 10, 2018, 07:20:42 am
content: Hi, I was trying to get FFT working on stm32 and the function 'arm_cfft_f32(&arm_cfft_sR_f32_len512,input,0,1);' works when I'm using qemu to simulate it but when I try to run the same program on the microcontroller it doesn't work. the array 'input' contains the right values after being processed in Qemu but when I run it in the actual hardware all the variables are Nan after being processed. I am using the GNU compiler and Eclipse IDE. the programmer is a Chinese stlink clone.full code in herehttps://pastebin.com/hh2R225nedit update 1: It seems like I was running out of RAM or ROM, I lowered the length to 256 and it seems to be working, will update if I get it fixed.update 2: after a little bit of fiddling around it seems to be working now.
SAMD10 TCC help - Page 1
Forum section: electronics / general

author: cl10Greg
author_rank: Newbie
timestamp: August 09, 2018, 01:17:40 pm
content: Hello Everyone,I am just trying to get a simple PWM to work but its not starting the clock it looks like. When I debug, the counter never increments for the TCC. I am just trying to put the signal out to PA04. I see that all the other settings are set while debugging just the clock isn't doing anything.Here is the code I am using for now:Code://Enable MUXPORT->Group->WRCONFIG.bit.HWSEL = 0x0;PORT->Group->PMUX.bit.PMUXE = 0x1;PORT->Group->PINCFG.bit.PMUXEN = 1;PORT->Group->WRCONFIG.bit.WRPMUX = 1;PORT->Group->WRCONFIG.bit.WRPINCFG = 1;//Enable TCCPM->APBCMASK.bit.TCC0_= 1;//Setup GCLKGCLK->GENDIV.reg = 0x00000000;while(GCLK->STATUS.bit.SYNCBUSY);GCLK->CLKCTRL.reg = 0x4011;while(GCLK->STATUS.bit.SYNCBUSY);GCLK->GENCTRL.reg = 0x00030600; //output enable is the big question.while(GCLK->STATUS.bit.SYNCBUSY);//Configure TCC and enableTCC0->CTRLA.bit.ENABLE = 0;TCC0->CTRLA.bit.SWRST = 1;while(TCC0->SYNCBUSY.bit.SWRST);TCC0->DBGCTRL.bit.DBGRUN = 1;TCC0->WAVE.bit.WAVEGEN = 0x2; //normal PWMwhile(TCC0->SYNCBUSY.bit.WAVE);TCC0->PER.bit.PER = 0x320;while(TCC0->SYNCBUSY.bit.PER);TCC0->CC.bit.CC = 0x50;while(TCC0->SYNCBUSY.bit.CC0);//TCC0->PATT.bit.PGE4 = 1;TCC0->CTRLA.bit.ENABLE = 1;while(TCC0->SYNCBUSY.bit.ENABLE);Thoughts?

author: cl10Greg
author_rank: Newbie
timestamp: August 09, 2018, 01:44:39 pm
content: I copied over the code from another project that I was working on and debugging......PORT->Group->PMUX.bit.PMUXE = 0x1; was for ADC and should be PORT->Group->PMUX.bit.PMUXE = 0x5; This works now...

author: ataradov
author_rank: Super Contributor
timestamp: August 09, 2018, 03:45:04 pm
content: Please, use defined values instead of 0x4011 or 0x00030600. This is impossible to read.Also, you don't need to enable the output for normal operation, you only need it if yo plan to put GCLK clock directly to the MCU pin.
Hitachi HD62023, NEC μPD1037: looking for datasheet - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: August 12, 2018, 11:14:44 am
content: so, I have recently come across this MPU used by Japan companies for their products. The MPU is old, made in the 90s, and it was innovative since it integrates a keyboard matrix scanner, an LCD controller, a serial and IrDA controller, as well as an asynchronous bus controller for common ram and mask-ROM devices, all in a small SMD chip.Unfortunately, I can't find the datasheet; there is a partial description of the reverse engineered microprocessor instruction set, from where it seems NM325 is the same as HD62023 is the same as μPD1037I'd like to see a description of the peripherals, their registers, as well as the PHY layer to interface them.e.g. the LCD's signals are { PRO, FR, LP, GC, DE }, but the timing is unknown, as well as the how you have to program the LCD-driver, where it is memory mapper, etc etcI don't have of course any commercial interest at programming it, and modern Japanese products in the class of PDA and pocket graphics calculators, are all oriented to SuperHitachi SH3, or ARM: it's rather for my pure personal curiosity

author: legacy
author_rank: Super Contributor
timestamp: August 12, 2018, 11:29:46 am
content: Released in November 2010, it's 8 years old and probably EOL in 2020, but it seems the Japan market usesePS6800, a RISC II Series MCU made by ELAN MICROELECTRONICS CORP.In this case, we are lucky, there is a partial datasheet release
[Solved] Mods please delete this - Page 1
Forum section: electronics / general

author: 3dgeo
author_rank: Frequent Contributor
timestamp: August 02, 2018, 10:02:24 pm
content: Noob mistake, issue solved.

author: johnkenyon
author_rank: Regular Contributor
timestamp: August 07, 2018, 11:24:29 am
content: You could have posted the solution so that future newbies can find the answer.../John
DMA interrupts and Channels  - Page 1
Forum section: electronics / general

author: benyB
author_rank: Newbie
timestamp: August 04, 2018, 12:20:06 am
content: Hi ,I'm trying to get 4 DMA streams working on stm32f7xI have 4 streams, 2 for Serial Audio Interface and 2 for uSD card. They are working but not at the same time !one of the possible SAI streams conflicts with the uSD card although its on a different channel. shares the same stream number.Can you use multiple streams on the same Stream number if its on a different channel ?if not then whats the point in having channels ? are channels a way of defining DMA mapping and that's all ?I tried avoided using the same stream number ( uSD and SAI ) by init and deinit the Audio input or output with the same stream number. (Audio is either played or being recorded so only one channel needed for audio)BUT, the interrupt points to the same DMA2_Stream4_IRQHandler and this causes a crashSo , my question is,1st , can DMA channels help ? if yes how can you have different interrupts for them ?2nd, can you define more than one interrupt for a DMA stream given that its not used at the same time?I'm assuming DMA2_Stream4_IRQHandler has to be used with Stream 4 but can you use DMA2_Stream7_IRQHandler on stream 4or define another ?ok, solution was this.. not sure if its the best way ?/*** @brief This function handles DMA2 Stream 4 interrupt request.* @param None* @retval None*/void DMA2_Stream4_IRQHandler(void){if (some_varibale = 1){HAL_DMA_IRQHandler(haudio_in_sai.hdmarx);}else{HAL_DMA_IRQHandler(haudio_out_sai.hdmatx);}}
Debugging arduino programs using for instance ATMEL-ICE - Page 1
Forum section: electronics / general

author: cdwijs
author_rank: Regular Contributor
timestamp: August 03, 2018, 08:07:19 am
content: Hi All,I am used to make electronic devices based on an Atmel microcontroller, using Atmel studio and C. I don't use any software libraries, everything is programmed from the ground up. Also the PCB's are hand made by me.This works, but it has a couple of drawbacks:1-This means if something goes wrong, I have to figure out all the problems myself.2-As my code is not prepared to use libraries, it's hard to integrate them into my program. This often means I only use libraries as a reference, while re-coding them. During this process I introduce new bugs, as I do not yet understand the library.3-The hand-written code is made for one processor. If I want a different processor, I have to re-write a good portion of the program.4-I can't buy PCB's with the microcontroller on it. It's time consuming to route etch (or order) a PCB, and solder the parts on them.Enter Arduino. In theory, it solves my problems:1) Many people know the code, so I can ask questions on the various forums.2) As many people have made libraries for Arduino, it's easy to integrate them.3) Many Arduino libraries are made for all the micro controllers that re on the various Arduino boards, so porting is usually no problem.4) I can buy standard PCB's, so I only have to create daughter boards if I want to do funky stuff.In practice, Arduino has its own share of problems:5) The official Arduino IDE does not have the editing facilities that Atmel studio has like code completion, code highlighting and so on.6) The official Arduino IDE does not support on-chip debugging. With Atmel studio, I can use my hardware debuggers to set breakpoints, inspect and modify the RAM contents, step through the code and so on.7) To try to solve 6, by importing an Arduino sketch in Atmel studio. This sometimes works, but sometimes, the importer makes mistakes, causing compiler errors. As Atmel studio is a closed source program, nobody except Atmel can fix this.Therefore I am looking for a way to:a) Use the Arduino libraries, as it provides functionality without having to code them myself.b) Use my debugger, as I make mistakes that i would like to be able to observe.Does anybody know a solution for this?Cheers,Cedric
Drop-in EEPROM replacement for PROM AM27C256 32 DIP? - Page 1
Forum section: electronics / general

author: CrazyFin
author_rank: Newbie
timestamp: July 31, 2018, 10:55:45 am
content: I have a HP 8920A with firmware A.16.00.I am planning to try out to upgrade the firmware to A.18.10 using firmware files found in the HP group in Yahoo groups.I am trying to figure out what EEPROM I can use as a direct drop-in replacement for the U401 PROM AM27C256 (32 pin DIP) on the signalling board in HP 8920A.I have been able to find out that I can replace the U1 to U8 PROMS that are AM27C040-120 in PLCC32 with W27E040P-12 PLCC32 EEPROMS.However, I am not sure what I can replace the U401 PROM that is a AM27C256 32 pin DIP PROM on the signalling board in HP 8920A.Any suggestions please?

author: Kjelt
author_rank: Super Contributor
timestamp: July 31, 2018, 11:05:03 am
content: Long time ago but IIRC it should be something like a 28C256

author: Kjelt
author_rank: Super Contributor
timestamp: July 31, 2018, 11:08:18 am
content: Are you 100% certain it is 32 pins dip not 28 pins ?For 28 pins this is an example for replacement:https://nl.mouser.com/ProductDetail/Microchip-Technology-Atmel/AT28C256-15PU?qs=sGAEpiMZZMuVhdAcoizlRSQWn4iDi6Wf2J%252bONJX6vDw%3d

author: CrazyFin
author_rank: Newbie
timestamp: July 31, 2018, 11:20:11 am
content: Quote from: Kjelt on July 31, 2018, 11:08:18 amYou are right! I checked again and it is indeed a 28 pin DIP...The AT28C256-15PU is not fully pin compatible? Looks like the pin 1 and 27 are switched on the AT28C256 versus the AM27C256?How about the AT29C256?https://www.mouser.se/datasheet/2/268/Atmel_AT29C256-1180383.pdf

author: Kjelt
author_rank: Super Contributor
timestamp: July 31, 2018, 12:16:14 pm
content: Quote from: CrazyFin on July 31, 2018, 11:20:11 amHmmm you're right, ofcourse you don't have a vpp on a eeprom but the /WE is kindof same functionality abstractly seen.QuoteLooks ok to me.Ofcourse this is a flash device which has different properties than an EEprom being:- less write cycles (typ. 10000 vs a few million for eeprom)- page erasable sometimes only page writable instead of byte writable like an eepromIn your case it does not matter since you only want to use it as firmware replacement (eg write once, read many).But in case of an eprom simulator or something that is written to many many times it might be important.

author: CrazyFin
author_rank: Newbie
timestamp: July 31, 2018, 06:26:32 pm
content: Ok excellent. Thanks for all the helpful and good advice.I will try with AT29C256.As you wrote, I will just update the firmware so no need of many re-writes.
Replacement for N-Mosfet which have GSD pinout - Page 1
Forum section: electronics / general

author: muthukural001
author_rank: Regular Contributor
timestamp: July 31, 2018, 12:48:09 pm
content: Hi,I did mistake in my board for footprint of SOT23-3 package mosfet. As a result, Drain and Source are changed. I am seeing all sot23-3 N mosfet with the standard pin-out as attached image(Existing). I want replacement in Gate Drain Source order as attached image (Replacement) .Thanks,Muthu