hybridfree/eevblog-posts huggingface dataset:
PIC24EPxxxMC/DSPIC33EPxxxMC HSPWM vs STM32F303 timer PWM - Page 1
Forum section: electronics / general

author: fourtytwo42
author_rank: Super Contributor
timestamp: April 24, 2018, 06:36:44 pm
content: Hi All I wonder if anybody else has experience of using the advanced PWM features of these chips ?I am a traditional PIC user and have been struggling mightily with the PIC24EP HSPWM for months, I use just about every feature it has at least output overide, auto shutdown and early termination. I am also using all 3 channels. Frankly IMOP it is riddled with bugs and my code has become riddled with workarounds! The errata is lengthy and incomplete, Microchip support show no interest and I am ready to throw the towel in.Meantime I have been investigating the STM32F303 that has a similar mix of analogue features and CPU power together with features in it's TIM1 peripheral that would apparently enable me to port my application to it. The errata for this chip is brief, is that an indication that the PWM bugs are few or have others been caught by many undocumented bugs here ?All comments welcome, but I won't get into fights over my opinion of the PIC HSPWM being full of bugs, if it works for you congratulations

author: josip
author_rank: Regular Contributor
timestamp: April 25, 2018, 06:20:23 am
content: BTW, right now, I am playing (in assembler) with timers on Kinetis (NXP) KL27 (Cortex-M0+). There are 3 timers, one with 6 output channels and two with 2 output channels. But there is also FlexIO module with 4 timers (1 timer / 1 output channel). There are 30+ pins (on QFP64) with mapped timer output channels.I just need a clock (50% duty, not PWM) but all mentioned timers are able to generate PWM signal. I also need synchronization between (all) regular and FlexIO timers, and I made this yesterday. And most important thing for me, that 8 output channels are available on one port, so pin mux (switch between regular port output and timer output channels) can be changed in one instruction. This device is with 2 ports (Timer 0 in combination with FlexIO, on port D and port E) with this possibility. I didn't found any other Cortex-M0+ (from any vendor) that can do this (and I search a lot).All timers can be also triggered (start / stop) with PIT. I don't need/use this. PIT in combination with DMA can be used to generate PWM signal on any port pin without using timers. I don't use this because of low precision and low output clock rate (1MHz).AN5209 Generating PWM by Using FlexIOAN4419 Using DMA and GPIO to emulate timer functionality

author: fourtytwo42
author_rank: Super Contributor
timestamp: April 25, 2018, 09:32:54 am
content: Thanks for the reply, I did look at the NXP K50 series that has a Cortex-M4 core and analogue peripherals. I checked out the documentation for the FlexTimer but it had several limitations (in relation to fault processing) that meant it could not do what I need.
Going bare with netbeans and writing code for AVR - Page 1
Forum section: electronics / general

author: Simon
author_rank: Unknown
timestamp: April 15, 2018, 04:54:21 pm
content: So I installed Netbeans and it picked up on the existing win AVR installation with the GCC compiler. but trying to compile an empty project I get:QuoteSomething to do with the "make file"

author: Simon
author_rank: Unknown
timestamp: April 15, 2018, 05:04:03 pm
content: Make.exe was unable to start correctly error code 0xc0000142
Samd20j18 external porgramming with Xplained Pro (Error 4109) - Page 1
Forum section: electronics / general

author: matthew_zammit
author_rank: Newbie
timestamp: April 12, 2018, 10:40:08 pm
content: Hi, I just recently finished soldering a prototype board for a project of mine and was trying to program the SAMD20J18 using the SAMD20 Xplained Pro's external debug functionallity via SWD. However Atmel studio keeps telling me that no device is detected and an error 4109 pops up.The Xplained Pro's debug led lights up green to signal that external debugging was detected.Can anyone point me in the right direction regarding this issue? This is my first PCB ever and am quite clueless on how to proceed. Thanks

author: JPortici
author_rank: Super Contributor
timestamp: April 13, 2018, 05:05:58 am
content: Hi,as far as i remember the debugger on a Xplained board is tied to the onboard target MCU, can't be used with other devices

author: ataradov
author_rank: Super Contributor
timestamp: April 13, 2018, 11:40:57 am
content: D20 is the only board where debugger is actually exposed to program external parts, not the on board MCU.As for the error, I would double check the connections, especially that you have power on the target, since that is how decides to switch to external connector.

author: matthew_zammit
author_rank: Newbie
timestamp: April 14, 2018, 07:59:57 am
content: Issue resolved. I had switched the nReset with Swdio on the cortex 10-pin header, no wonder it wasn't working
Any good VHDL training courses? - Page 1
Forum section: electronics / general

author: Pack34
author_rank: Frequent Contributor
timestamp: March 13, 2018, 11:18:31 pm
content: I need to brush-up on my VHDL. Are there any training courses for it like Fedevel for Altium?

author: jamiechi
author_rank: Contributor
timestamp: April 07, 2018, 07:56:03 pm
content: I would check Youtube for online video tutorials for VHDL.

author: rstofer
author_rank: Super Contributor
timestamp: April 08, 2018, 02:14:01 am
content: Digilent has some programshttps://learn.digilentinc.com/classroom/They make a number of boards aimed at education.

author: jackbob
author_rank: Regular Contributor
timestamp: April 09, 2018, 10:15:10 am
content: There are some videos online but there arent many good ones on YouTube for vhdl. I am in the process of starting a FPGA and VHDL video series but they will be coming out one video at a time and will probably take many months to complete. If you or anyone reading this is interested here is the linkIntroduction to FPGA's and VHDL For Beginners:https://www.youtube.com/playlist?list=PL7EPI_3oZX_wiq2NJBFJGvUD0dsnChRi9

author: kfnight
author_rank: Regular Contributor
timestamp: April 09, 2018, 03:45:38 pm
content: My favorite VHDL book is Circuit Design and Simulation with VHDL by Pedroni, and it's reasonably priced. It includes a good chunk of the "new" VHDL-2008 constructs.

author: Mr. Scram
author_rank: Super Contributor
timestamp: April 09, 2018, 04:07:38 pm
content: I enjoy the Free Range VHDL book. It's free.http://www.gstitt.ece.ufl.edu/courses/eel4712/labs/free_range_vhdl.pdf

author: jackbob
author_rank: Regular Contributor
timestamp: April 10, 2018, 02:18:31 am
content: If you are looking for any resource I would highly recommend the Free Range VHDL Book Mr. Scram provided. This book is very well written and is the book I reference and recommend in my video tutorial series. If you are only looking for online video resources there are some produced on youtube many years ago by some college departments that are good if you have already possess some understanding of VHDL. There are also some good videos produced by Jordan Christman on Udemy (but these are not free) they are worth the money but emphasize design more than actually thoroughly describing the VHDL language first.

author: james_s
author_rank: Super Contributor
timestamp: April 10, 2018, 03:41:18 am
content: I second the recommendation of Free Range VHDL, I found it very helpful when I was learning.

author: WanderAway
author_rank: Newbie
timestamp: April 16, 2018, 07:19:04 am
content: I've found that unlike languages like C, HDLs are lacking a lot of in depth tutorial. I know a bit of VHDL and Verilog, but there are so many useful features that are not apparent until you know what you are looking for. How I learned VHDL is through working with someone in the industry doing RTL design, and Google of course.This is not really a tutorial per se, but it is an extremely useful reference:VHDL Golden Reference Guide, Doulos
Embedded GUI Library - Page 1
Forum section: electronics / general

author: emrelabs
author_rank: Newbie
timestamp: April 09, 2018, 09:18:03 pm
content: Hello all,This is Emre. I am work on a Embedded GUI Library for Cortex-M microconttroller.Sample video with STM32F103VCT6 microcontroller:Resolution: 480 x320 (16Bit)Lcd bus: 16bit FSMCAll images and icons stared at SPI flash (8MByte @36Mhz)No internal frame buffer(Sorry for bad video quality, i will share better version)I want to make programmable smart display product family based on this GUI library. (Similar to Nextion Display) Nextion display has some problem. For example fonts are realy bad and ugly. My GUI library support proportional and anti-aliased(4-bit) fonts. Are there any other suggestions for make a good product than nextion?Sorry my english,Thank you.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 09, 2018, 11:37:42 pm
content: if we can analyze the source code then we can give better suggestion...

author: Dubbie
author_rank: Unknown
timestamp: April 10, 2018, 08:30:05 am
content: Good job supporting proportional and properly anti aliased fonts.This is the Achilles heel of many libraries.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: April 10, 2018, 10:58:27 am
content: Without seeing the code I would say that modularity of the code design is important.Separate the protocol that is spoken to the display from the graphics code and separate how the display is interfaced (hardware connections) from the protocol (and other) code (this goes for any externally interfaced hardware - but is almost never done right). I should not have to reimplement the protocol if I decide to interface the same display differently. I should only have to write a 'protocol-driver' when I want to attach a display that you currently do not support.Allow graphics functions to be overridden and extended and higher order gui functions to be used to compose the desired result. I should be able to create triangle-buttons by composing button eventing (click) logic with a (custom) draw routine (triangle) and the existing text routine.

author: cgroen
author_rank: Unknown
timestamp: April 13, 2018, 05:04:09 pm
content: Also look at emwin from Segger, their way of implementing stuff is not the worst I have seen (or worked with) !
Program-O-Tron Standalone AVR programmer - Page 1
Forum section: electronics / general

author: drewanderson
author_rank: Newbie
timestamp: April 11, 2018, 09:11:59 am
content: Hi Guys & Girls,We have designed a programing board for AVR Microcontrollers, to allow our more non technical staff to program chips without a computer! Even our technical staff are using these, as it makes the programming as easy as pressing a button. The programmer uses an SD card to store 7 HEX and fuse files (1 being a slot for the copy and paste feature), and has an onboard ZIF socket for ATMEGA328 and ATTinyX5 Chips, as well as an ICSP header to program chips in circuit.http://kck.st/2GIgdHL
Which IDE support ATmega8A with Atmel ICE - Page 1
Forum section: electronics / general

author: muthukural001
author_rank: Regular Contributor
timestamp: April 10, 2018, 03:28:02 pm
content: Hello All,I need to develope code for ATmega8A and only programmer I am having is Atmel ICE. I tried to develop code using Atmel studio 7.0 and got a lot of undeclared error that I am not aware.Errors like,'PRR0' undeclared (first use in this function)'PRADC' undeclared (first use in this function)'PRITIM1' undeclared (first use in this function)tried the same with Atmel studio 6.2 which is the minimum version needed to support Atmel ICE and got the same error.Please suggest.Thanks,Muthu

author: ajb
author_rank: Super Contributor
timestamp: April 10, 2018, 06:10:41 pm
content: Those don't look like standard AVR names. Typically the avr header files use singly defined names for peripheral registers, so for instance USART 0 Control Register A will be named UCSR0A, Control Register B will be UCSR0B, etc. Unlike some other platforms, they don't tend to define structs for peripherals. The exception, IIRC, are the XMega parts, which I believe do have structs defined.Atmel Studio is really good at just working (except when it doesn't), so make sure to use the new project wizard and properly select your part. That should include the right header files. Then consult the header files or some example code to figure out the proper register names. Once you know the scheme it's pretty easy to figure out the names you want.

author: westfw
author_rank: Super Contributor
timestamp: April 10, 2018, 08:36:40 pm
content: The missing symbols are bits in the power reduction register PRR, which doesn't exist on an atmega8.You're probably trying to compile software that was designed for the ATmega168 to ATmega328 family chips.(Arduino SW, perhaps? Although the Original Arduinos had an ATmega8 chip, a lot of the more recent libraries and examples don't try to be backward compatible to the older chips.)
I just redrawn PICKit 2 - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: April 08, 2018, 07:49:23 pm
content: It has appeared to me that ever since PICkit 3 some features of the PICkit 2 has been missing. Instead of using whatever was available on Taobao, I decided to redraw this thing.Design constraints:100% code compatible with PICkit 2Fuse the VBUS, VDD and VPP lines (like PICkit 3)Increase the power capacity of VPP and VDD linesConsolidate the two 24LC512 chips into one AT24CM01Here is the schematics:
Remote and local control panels for an irrigation controller - Page 1
Forum section: electronics / general

author: e100
author_rank: Frequent Contributor
timestamp: April 07, 2018, 06:59:24 am
content: Has anyone done any projects where there was a need for two control panels, one back at base, the other out in the field?If you are in the field then you need to be able to take local control locking out the base control panel until you've finished what you are doing.Likewise if you return to base and forgot to relinquish field control then you need a way of forcibly resuming base control.I realise that for this to make sense to the operator both panels would need to use stateless hardware controls, so switches would have to be momentary and rotary encoders would be needed to change numeric values.Whichever panel is in charge would need to broadcast a flag saying that's it's in control and also listen for the same signal from the other control panel incase it wanted to take over. (The intention is to link everything together with CAN bus so messages rather than hardware i/o lines will be used for communication.)It sounds like a deceptively simple thing to implement but not having done this before I'm not so sure. Are there any gotchas that I should be aware of?

author: woody
author_rank: Frequent Contributor
timestamp: April 07, 2018, 08:19:22 am
content: I would not let the control panels themselves decide or check who is in control. Let the central system do that.Keep the settings central. Let a control panel know its state, either in control or not in control. Indicate with an led. Whenever a switch is pressed or a rotary encoder is turned while a panel is not in control, request control from the central system. Then retrieve the settings and present them on the control panel. Dial in the required settings and store them centrally.If you don't want the hassle of reading buttons and checking control all the time you could also make a separate 'take control' button on the control panels. And if you make that an RFID card reader that also solves the collision problem; only the one with the card can take control. Although this introduces another problem when the card goes missing :-)Interesting challenge. I once made a gate controller with a couple of wirelessly attached card readers that also were used to program cards, and it is as you said: deceptively simple.
Tiva TM4C123 / Edubase LCD not working - Page 1
Forum section: electronics / general

author: mlugo2
author_rank: Contributor
timestamp: April 04, 2018, 09:05:43 pm
content: I'm working through the book"Practical Microcontroller Engineering with ARM Technology"and got to the LCD example on chapter 8. I followed the code and it didn't work; then downloaded the source code and got the same result. Here's my source code:https://gist.github.com/mlugo2/94cdbd9d79ffc8890aa4ebad990d5abfBasically the LCD just blinks. I would appreciate any help, thanks!

author: TK
author_rank: Super Contributor
timestamp: April 04, 2018, 11:58:32 pm
content: There should be a pot to adjust the contrast of the LCD. It seems to be at max setting.

author: Naguissa
author_rank: Regular Contributor
timestamp: April 05, 2018, 06:53:39 am
content: Just below LCD in picture there's a jumper labeled LCD. Have you checked all jumper settings for that example?

author: pigrew
author_rank: Frequent Contributor
timestamp: April 05, 2018, 01:29:53 pm
content: This may have little to do with your issue, but I suggest removing R9 and R10 from the PCB. They short IO pins pins together, and are for compatibility with some msp430 expansion boards. Just be aware of them....

author: mlugo2
author_rank: Contributor
timestamp: April 05, 2018, 01:58:24 pm
content: Thanks for all the suggestions! I'll let you know the results when get a chance
Cypress SPI NOR Flash memory initialization error - Page 1
Forum section: electronics / general

author: madhu.wesly01
author_rank: Regular Contributor
timestamp: April 05, 2018, 10:40:57 am
content: Hello everyone,I am using Cypress SPI NOR flash as Data logger in my board. Actually, in datasheet about RESET# and WP# pins it is mentioned to put "left unconnected if not used". I followed it and my board got assembled now while checking it is not showing high at RESET and WP pins on my physicaal board, it is showing 0.60V floating value. Hence, the logger is not getting initialized.Can anyone please let me know how to make the RESET and WP pins high in Software? Also if anyone knows please let me know recommended library(Arduino IDE Environment)? What would be the reason for the pins being floated?IC Datasheet :https://www.mouser.in/datasheet/2/100/002-12878_S25FL064L_64-Mbit_8-Mbyte_3.0_V_FL-L_SPI-1102570.pdfAwaiting reply.Thanks in advance.
STM32F103C8 DMA to GPIO - Page 1
Forum section: electronics / general

author: maurosmartins
author_rank: Regular Contributor
timestamp: April 02, 2018, 10:14:23 am
content: Hello all,I'm trying to setup a a configuration using DMA to GPIO on a STM32F103C8 microcontroller for use with a display that has 8bits parallel interface (ILI9481). I've found the following application note AN4666 that guides through the process of using a timer in pwm mode and it will also be responsible for the DMA requests but I have some doubts.so far I have the timer set and the following DMA1 CH2 configuration adapter from an example as I intend to use channel 1 of Timer 1 as the trigger:Code: (c)DMA_HandleTypeDef hdma_tim1;__HAL_RCC_DMA1_CLK_ENABLE();hdma_tim1.Instance = DMA1_Channel2;hdma_tim1.Init.Direction = DMA_MEMORY_TO_PERIF;hdma_tim1.Init.PeriphInc = DMA_PINC_DISABLE;hdma_tim1.Init.MemInc = DMA_MINC_ENABLE;hdma_tim1.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; //8 bitshdma_tim1.Init.MemDataAlignment = DMA_PDATAALIGN_BYTE;hdma_tim1.Init.Mode = DMA_NORMAL;hdma_tim1.Init.Priority = DMA_PRIORITY_LOW;HAL_DMA_Init(&hdma_tim1);__HAL_LINKDMA(&htim1,hdma,hdma_tim1);htim1->hdma->XferCpltCallback = data_tramsmitted_handler;htim1->hdma->XferErrorCallback = transmit_error_handler;HAL_DMA_Start_IT(htim1.hdma,(uint32_t)&my_data_buf, (uint32_t)&GPIOA->ODR, my_data_buf_length);I understand almost everything but this:Code:__HAL_LINKDMA(&htim1,hdma,hdma_tim1);also after starting the dma transfer do I have to manually start the pwm and when the XferCpltCallback is called do I have to manually stop the pwm signal?thanks in advanced,Best regards, Mauro.
Running a 3.3V STM32F0 on 6.5V - Page 1
Forum section: electronics / general

author: inevitableavoidance
author_rank: Contributor
timestamp: March 31, 2018, 05:30:53 pm
content: I'm using an STM32F0 in a high volume low power project running on a LIR2032 that can be charged via USB using an MCP73831. The STM is specd at 2.4 - 3.6V, with 4.0V as the absolute maximum. When the battery is fully charged however the voltage will be 4.2V, 0.6V out of spec.Now, if I power the device with 6.5V it actually still runs fine, except for a drawing scary high currents (81uA in standby compared to 3.12uA on 3.3V). What exactly happens when you apply a too high voltage to a device like this, and what are the actual risks?Thanks in advance!David

author: technix
author_rank: Super Contributor
timestamp: April 01, 2018, 06:04:34 am
content: You are lucky that the chip can withstand that high a voltage without letting out the smoke... It shortens the life of the chip significantly even if it works fine, and you have no guarantee that every chip would work at this extreme overvolting.You should have added one of those battery buck-boost converters so your chip can operate at a stable 3.3V.

author: Seekonk
author_rank: Super Contributor
timestamp: April 01, 2018, 07:21:08 am
content: Use the voltage drop of a diode or two to supply power. I was given a watt meter that didn't work. First I checked voltage on the chip and it was 11V on a 3V3 micro. Replaced the regulatoe and it has been working for years. Who da thunk.

author: hans
author_rank: Super Contributor
timestamp: April 01, 2018, 08:00:09 am
content: I would be careful with a diode drop in your design. Under load it may drop too much that you want to use a Schottky diode, but in sleep a Schottky diode may only drop 100-200mV at 10uA (often not specified in datasheets), which then increases the supply voltage again.An active regulator of somekind would do better.. Not sure if it needs to be buck-boost. You could perhaps also use a buck converter and run your whole design at e.g. 2.7V or another low voltage, such that the converter has enough headroom at the lowest battery voltage you need to support.I wouldn't let a microcontroller run at elevated voltages all day.Or in extreme cases for short periods. At a previous job I've seen a fault of a production test jig, that put 12V briefly (like 2s at most) on the internal 3.3V of the product during programming. Complaint was: the devices wouldn't program. I fixed the jig, but the devices used to diagnose the problem were scrapped. In that case a failure of such a device could lead to a road accident, so no chances taken.
TXS0108E voltage drop! - Page 1
Forum section: electronics / general

author: salviador
author_rank: Regular Contributor
timestamp: March 31, 2018, 10:15:27 am
content: Hi ,I have a problem with TXS0108E , I want convert 3v3 Volt of stm32 to output 5V.ConnectConnect :1) TXS0108E, VCCA (3v3) and VCCB (5 Vcc) power source2) TXS0108E, A1....A8 to gpio STM32 configure to output3) TXS0108E, B1...B8 to Led Red smd (1.6v) , with 1500ohm resistor in series for each channelI have a problem, no load (led) In the output I have 5volt ! its ok level convert work!!!with the load of the led, the output (example B1 of TXS0108E) conect to resistor 1500ohm to anode Led and katode to ground , the voltage of B1 drop at ~2.3Volt !!! why???

author: kony
author_rank: Regular Contributor
timestamp: March 31, 2018, 12:52:43 pm
content: Read the chip datasheet. It is not designed for sourcing current to other loads than logic inputs (weak pull-up with risetime accelerator circuit). If you need to use common cathode configuration, drop there some PMOS, or better yet change it and use open drain configruation with the translator instead.
STM32F723E-DISCO USB Examples? - Page 1
Forum section: electronics / general

author: Pack34
author_rank: Frequent Contributor
timestamp: March 30, 2018, 03:23:43 am
content: I'm having a little bit of trouble finding some USB examples using ST's F7x3 line. These are supposed to have an integrated USB-HS PHY and I'm interested in trying them out.My end goal is to simple USB com, ideally using libusb and eventually adding some DMA capabilities.

author: krho
author_rank: Regular Contributor
timestamp: March 31, 2018, 06:54:52 am
content: Donwnload Stm CubeMX, and HAL for the STM32F7 family, then start a new project select the board....
STM32F407 ADC total conversion time / External ADC - Page 1
Forum section: electronics / general

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: March 31, 2018, 03:11:44 pm
content: Hello,Here is a part of the STM32F407 datasheet and ADC section. it is mentioned that ADCTotal conversion timecould vary between 0.5-16.4uS for 12bit resolution, but it has not mentioned what will cause this variation or when we will get the minimum or maximum delay.Second, with an ADC with such characteristics, such as 2Msps (up to 6Msps), what is the need of external ADCs?

author: Siwastaja
author_rank: Super Contributor
timestamp: March 31, 2018, 03:30:18 pm
content: Configurable sampling time. You can use the shortest setting when you have a well buffered low-impedance input.See the reference manual; it describes the timing quite well.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: March 31, 2018, 06:58:13 pm
content: Quote from: Siwastaja on March 31, 2018, 03:30:18 pmDo you have an idea for the second question? Written below the image

author: ajb
author_rank: Super Contributor
timestamp: April 01, 2018, 05:44:52 am
content: You may want to use an external ADC for better accuracy, better precision, higher sample rate, or because you need a different input or reference structure, or because you need to sample more channels, or because it results in a better overall system design (separation or even isolation of analog/digital sections), or because you need to sample something all the way on the other side of the PCB, or any number of other reasons.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: April 01, 2018, 07:03:58 am
content: Quote from: blueskull on April 01, 2018, 05:47:33 amI want to use LF357 or AD797 before injecting the signal to the MCU ADC because the frequency of the signal is 1KHz maximum, but it contains high frequency and very small variations in a short piece of time (it happens on falling edge). therefore the signal gets amplified before, but is it good enough to match the impedance for the MCU ADC?The ADC can be fixed to have 2..6MSPS and 12Bit, which is good for this application, but I am not quite sure if it works "stable enough-less errors", or I need to install the same or better external ADC.
68HC05 instruction timings - Page 1
Forum section: electronics / general

author: Maximumspatium
author_rank: Newbie
timestamp: March 29, 2018, 12:15:32 pm
content: Hello crews,does anyone have a good knowledge of the instruction timings of the legacy 68HC05 MCU family? I'm currently trying to understand a firmware of a legacy 68HC05-based device that uses various kinds of waiting loops implemented in the software. In oder to understand them, I need to know how much time each instruction actually takes.I own a copy of the Motorola user's manual that specifies instruction timings in cycles. What I don't understand is the duration of the single cycle. My device is clocked with a 32768 Hz watch crystal. But the 68HC05 series apparently uses the so-called "bus cycle" for instruction fetching and execution. Unfortunately, I couldn't find any explanation of these mysterious bus cycles and their duration.Can someone shed some light on this?Thanks in advance!CheersMax

author: 0xfede
author_rank: Regular Contributor
timestamp: March 29, 2018, 04:18:31 pm
content: Hello Maximumspatium,the MC68HC05 has bus speed = Fosc/2 or Fosc/32 (the latter if slow mode bit is set).You can find this info on the datasheet @page 54, here is the link:https://www.nxp.com/docs/en/data-sheet/MC68HC05X16.pdfBest,0xfedeEDIT: corrected copy/paste typo in page number

author: westfw
author_rank: Super Contributor
timestamp: March 30, 2018, 12:24:02 am
content: (agreeing with 0xfede):Quote
Verilog- test bench: Task control - Page 1
Forum section: electronics / general

author: Digital_Treasure
author_rank: Newbie
timestamp: March 29, 2018, 03:12:04 pm
content: Hello,I have a strange question with regards to task control in verilog test bench, so please bear with my attempt to trying to keep it to a simple form.I have a task flow inside a file, for which I am not permitted to change anything. For example;1) File: Faultstask examine;begintask a();task b();endthe explanations for task a and b are also inside the file-Fault for which I am not permitted to make any changes.However I am using the above task in my test case2) File : Testcase_1task xyz;task examine;task hml; etc..however there is a problem with task a. when task-a runs, there is a variable inside that task which is changing wrongly and I have to force the variable to follow the right formula somewhere else and correct it without doing the task correction in the Faults file.I have access to another file called as File: utility where I can write the correct formula to force the variable to follow the new formula, get changed and then continue executing with task b and so on in my test case and produce the results.But I dont know how can I stop task a in the middle and then change the variable(force it follow a new formula and get the right value) and then continue with task b and so on. Can anybody help me with this???i am happy to provide additional info if required. Thanks in advance
Embedded.FM episode 238: MY BRAIN IS MY TOOLBELT - Page 1
Forum section: electronics / general

author: MasterBuilder
author_rank: Regular Contributor
timestamp: March 28, 2018, 11:18:51 am
content: A heads up for those who have missed it.Elecia and Chris White of the excellent Embedded.fm podcast have posted an outstanding episode where they go into the design of a very interesting embedded system.https://www.embedded.fm/episodes/238
looking for SAML21 TCC's non ASF code - Page 1
Forum section: electronics / general

author: arul
author_rank: Regular Contributor
timestamp: March 28, 2018, 06:54:33 am
content: Hi,I want sample code of TCC for SAM L21. Please share if anyone have...Regards,Arul

author: ataradov
author_rank: Super Contributor
timestamp: March 28, 2018, 07:31:41 am
content: I only have the code for D21. It is essentially the same code, but APBxMASK is located in MCLK, not in PM. And clock enabling will look something like this:Code:GCLK->PCHCTRL.reg = GCLK_PCHCTRL_GEN(0) | GCLK_PCHCTRL_CHEN;while (0 == (GCLK->PCHCTRL.reg & GCLK_PCHCTRL_CHEN));Also, TCC has many modes. The code below is for simple PWM.Code:void APP_PwmInit(void){HAL_GPIO_R_out();HAL_GPIO_R_pmuxen(PORT_PMUX_PMUXE_F_Val);HAL_GPIO_G_out();HAL_GPIO_G_pmuxen(PORT_PMUX_PMUXE_F_Val);HAL_GPIO_B_out();HAL_GPIO_B_pmuxen(PORT_PMUX_PMUXE_F_Val);HAL_GPIO_W_out();HAL_GPIO_W_pmuxen(PORT_PMUX_PMUXE_F_Val);PM->APBCMASK.reg |= PM_APBCMASK_TCC0;GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID(26/*TCC0_GCLK_ID & TCC1_GCLK_ID*/) |GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN(0);TCC0->CTRLA.reg =TCC_CTRLA_PRESCALER(TCC_CTRLA_PRESCALER_DIV1_Val) |TCC_CTRLA_PRESCSYNC(TCC_CTRLA_PRESCSYNC_PRESC_Val);TCC0->WAVE.reg = TCC_WAVE_WAVEGEN(TCC_WAVE_WAVEGEN_NPWM_Val);TCC0->PER.reg = PWM_TOP;TCC0->CTRLA.reg |= TCC_CTRLA_ENABLE;}static void pwmUpdatePwmChannels(void){TCC0->CTRLA.reg &= ~TCC_CTRLA_ENABLE;TCC0->COUNT.reg = 0;TCC0->CC.reg = 111;TCC0->CC.reg = 222;TCC0->CC.reg = 333;TCC0->CC.reg = 444;TCC0->CTRLA.reg |= TCC_CTRLA_ENABLE;}
I am unable to use C Macro related to peripherals of PIC32mx. [Solved] - Page 1
Forum section: electronics / general

author: abrarbaig
author_rank: Contributor
timestamp: March 20, 2018, 11:19:39 am
content: I am unable to use C Macro related to peripherals of PIC32mx. I am using xc32 v1.43 . I use #include<plib.h> as mentioned in the literature. I am using MPLabXIDE v 4.01

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 20, 2018, 12:22:00 pm
content: http://www.microchip.com/SWLibraryWeb/product.aspx?product=PIC32%20Peripheral%20Library

author: abrarbaig
author_rank: Contributor
timestamp: March 21, 2018, 07:34:23 pm
content: Thanks . I have downloaded the additional software.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 21, 2018, 09:41:39 pm
content: No problem.Microchip is making the "peripheral libraries" deprecated, this is why they don't include that as standard with their compilers anymore. They will probably remove them altogether one day or another, so I would suggest you start working on doing without them, either by using Harmony (*cough cough*, I wouldn't), or directly control the peripherals by their registers, it's not that difficult, and the peripheral libraries source code can get you started.

author: abrarbaig
author_rank: Contributor
timestamp: March 26, 2018, 05:34:54 am
content: Thanks for your suggestions. I used to control SFR's directly but I just wanted to try macros as well.
Notepad++ in Arduino IDE - Page 1
Forum section: electronics / general

author: medical-nerd
author_rank: Regular Contributor
timestamp: March 20, 2018, 06:13:19 pm
content: HiyaThis is a cross-post from another section, I now realise it would be better posted here - hopefully someone can help me.Quote from: medical-nerd on March 19, 2018, 11:24:01 pmI have a file open in Notepad++, when I follow the instructions to Run - ArduinoIDE (step 20 above)I get a ShellExecute error.The system cannot find the file specified.An attempt was made to execute the below command.---------------------------------------------------------------Command: C:\ProgramArguments: Files (x86)\Arduino\arduino.exeC:\Users\steve\Desktop\dds\Rotary\examples\interrupt\Interrupt1.inoError Code:2--------------------------------------------------------------The Interupt1.ino is the file I am trying to import into the Arduino IDE and compile.It does exist in the folder/file specified in the error.Cheers

author: Nusa
author_rank: Super Contributor
timestamp: March 20, 2018, 06:48:29 pm
content: Spaces in the resulting (hidden) command line that's being executed are being parsed incorrectly. And, of course, windows installs everything by default in a directory with spaces in it.I've no experience with NPP itself, but I suspect that going back and adding surrounding quotes in step 16 will fix it.e.g.: "C:\Program Files (x86)\Arduino\arduino.exe"If that doesn't work, you can use the short file name alternative:Open a cmd window. To see short names: DIR /X C:\In step 16 replace the Program Files (x86) part with that short name....probably something like PROGRA~2If that doesn't work, then I'd suggest reinstalling the arduino environment in a different directory, one without spaces. Then do step 16 again. (That is what the guy who gave you the instructions did, from his example.)

author: Naguissa
author_rank: Regular Contributor
timestamp: March 22, 2018, 12:10:17 pm
content: You can also use Eclipse, but even upload to Arduino without opening Arduino IDE:https://translate.google.com/translate?sl=es&tl=en&js=y&prev=_t&hl=es&ie=UTF-8&u=https%3A%2F%2Fwww.foroelectro.net%2Felectronica-digital-microcontroladores-f8%2Fide-eclipse-para-programar-arduino-incluyendo-esp8-t177.html&edit-text=&act=url
Memory selection for STM32F205RG - Page 1
Forum section: electronics / general

author: trungosu
author_rank: Contributor
timestamp: March 21, 2018, 03:06:04 pm
content: Hi,I want to build a data logger and I want to use an micro usb to access the data in memory.Looks like the options are Flash memory, EEPROM or NAND memory but I could not find any information about how to access it from micro usb.Imagine something like a phone when I plug a usb cable with pc, I could access some media folder.Thank you very much.

author: voltsandjolts
author_rank: Unknown
timestamp: March 21, 2018, 03:35:56 pm
content: Lots of examples on the web e.g.:http://www.keil.com/download/docs/362.aspTry search terms:mass storage device microcontroller

author: technix
author_rank: Super Contributor
timestamp: March 21, 2018, 08:16:31 pm
content: This means you need two parts: to store the data and to get the data. That is two separate tasks for the firmware and have to be dealt with separately.You can store data into some kind of non-volatile memory, like Flash memory, be it bare NAND on FSMC, managed NAND (eMMC or microSD) on SDHC, or NOR on QSPI.To access the data over USB you need some kind of USB-based protocol. If your data can be treated as files and you don’t mind using a file system (especially on a managed NAND) you can use the USB Mass Storage class, allowing accessing the data as a disk to the computer. For this use case your firmware must unmount the storage device (thus disable datalogging) before allowing the host to access it, or locking the data will be a nightmare.If you want more flexibility or need to keep the datalogging going even when connected, depending on the bandwidth requirement, you might need your own USB class protocol or use USB Human Interface Device interface. USB HID is capped at 64kbps over Full-Speed though, but it can be programmed more easily using libusbhid across all platforms. For your own custom class protocol libusb is pretty straightforward on all platforms but you need some trickery or deep pockets to allow Windows to load the appropriate driver.
How to add a device to tavrasm? - Page 1
Forum section: electronics / general

author: RES
author_rank: Regular Contributor
timestamp: March 21, 2018, 03:57:34 pm
content: Who is using tavrasm? How can I add a new device to tavrasm? Assembling results in this device error: (plus many others)pi@bpi-iot-ros-ai:~/Downloads$ tavrasm AD5231.asmAD5231.asm:18: Error : Unable to open file 'tn26def.inc'...
Why do some chips come as bare silicon ? - Page 1
Forum section: electronics / general

author: Beamin
author_rank: Super Contributor
timestamp: March 19, 2018, 07:59:06 pm
content: That seems like a terrible idea. It's like the chip is naked. And in the case of the raspberry pi delicate even to light. It seems like the black plastic would be the easy part. Why do they do this? At least put it in a blob of black stuff or something! I'm always super cautions about even toughing it.

author: lgbeno
author_rank: Frequent Contributor
timestamp: March 19, 2018, 08:09:44 pm
content: It is the smallest possible package and also the least expensive. The light sensitivity of the Raspberry PI regulator is a little of an anomaly, most electronics are enclosed, also it was mostly susceptible to a Xenon Flash, not regular light levelsSent from my iPhone using Tapatalk Pro

author: Twoflower
author_rank: Frequent Contributor
timestamp: March 19, 2018, 08:31:29 pm
content: It depends: One option is going cheap: Glue the die on the PBC band wire-bond the connections. The other is size does matter in some cases (like the one you mentioned on the RasPi).Some designs are so dense you can't fit any housing or protection-coating in it. Look at (Micro-)SD cards for example or Smart-Phones and Smart watches. The manufacturer fight for each fraction of a mm. Sometimes it has also some electrical reasons. As routing high speed signals through a housing will reduce the signal quality which can be avoided if you mount the die on the PCB.You should keep in mind that in a end-user product you usually don't have access to this parts. So why bother placing them under a blob? And the people handling these bare die packages are aware what they do. Or at least they should. The many destroyed AMD processors some time back show this exactly: If handled with care you're safe. But if you're a bit too careless mounting the heat sink or bumpy transport with a heavy heat sink and you created a expensive paperweight.To my understanding the coating is has to be used for wire bonded chip on board solutions as the wire-bonds are very fragile. See cheap multimeters or displays.And the light sensitivity is not a problem for end user products. As they are usually build in into housings that keeps light from these devices. But actually some SanDisk seem to have a semi-transparent housing: Here I really wonder why as some card readers have half of the memory card exposed. And light could potentially create some charges in an un-powered card that has some influence on the memory cells.Fun fact: The 200MByte SanDisk MiroSD card is not even painted because it would exceed the allowed dimensions.
AVR SPI slave - how to get an interrupt when SS initially goes low? - Page 1
Forum section: electronics / general

author: HwAoRrDk
author_rank: Super Contributor
timestamp: March 28, 2018, 07:42:16 pm
content: With the SPI peripheral common to most AVR microcontrollers, I know that you can configure things so that when operating in slave mode you can have an interrupt triggered when a data transfer is complete - i.e. the SS pin returns to high.Is there any way to trigger an interrupt when the SS pin initially goes low? Is it possible to, for instance, enable a pin-change interrupt on the SS pin - will it still fire even though the SS pin is being used by the SPI peripheral? Or does the SPI override all other functionality?What I would like to be able to do is capture the state of a couple of other tangentially-related I/O pins at the moment the SS pin goes low.

author: technix
author_rank: Super Contributor
timestamp: March 28, 2018, 09:00:55 pm
content: If I recalled it right thein change interrupt and SPI slave select can be used at the same time. So try set up a PCINT on the SS pin?

author: HwAoRrDk
author_rank: Super Contributor
timestamp: March 28, 2018, 11:10:05 pm
content: Okay, cool, thanks, I will give that a try then.Of course, a backup plan is always to run the SS line to a second pin in parallel and use an interrupt on that, but reducing the number of pins used is always a good thing.

author: C
author_rank: Super Contributor
timestamp: March 29, 2018, 12:52:20 am
content: 1. Set up the second ping and get it to working.2. When this is good, just change the pin number.#1 proves your code is good.#2 tests if int & SS will work at same time.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: March 29, 2018, 12:59:54 pm
content: I'm trying this out and a pin-change interrupt doesn't seem to be working.SPI lines are hooked up in parallel to and being driven by another device, and I just have the PCINT for now - the SPI peripheral is not configured at all yet.I know the PCINT code I have is correct, as if I unplug the SS line, it gets triggered due to the floating input. But when connected: nothing, nada, zip, never triggers.Is there some kind of maximum frequency of signal which a pin-change interrupt can handle? The secondary master device driving the SPI bus should be toggling SS about 110-140 times per second, which is not exactly mega-fast.I will get the oscilloscope out to check what the AVR's SS pin is seeing, but SPI communication between the master/slave devices is working just fine, so I can't believe there is anything wrong with the signal.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: March 29, 2018, 03:10:26 pm
content: Sigh...Never mind, it was a wiring problem. A bad breadboard jumper wire.Edit:Also, can confirm now that a pin-change interrupt can be used concurrently on the same pin being used as the SS for SPI.
Arduino / RFID / SDFat mysteries - Page 1
Forum section: electronics / general

author: ggchab
author_rank: Frequent Contributor
timestamp: March 16, 2018, 11:41:39 am
content: Hello,I am working on a small project that uses an Arduino compatible board (Teensy 3.2), an RFID module (Velleman VMA405) and the microSD module from an LCD display (Velleman VMA412) .I can't make the RFID and SdFat libraries working together. Here is a simple test code:Code:#include "spi4teensy3.h"#include "RFID.h"#include <SdFat.h>#define RFID_CS 10 // RFID board ChipSelect signal#define RFID_RST 9 // RFID board Reset signal#define SD_CS 16 // SDcard ChipSelect signalRFID rfid(RFID_CS,RFID_RST);SdFat SD;void setup() {Serial.begin(9600);SPI.begin();delay (100);rfid.init();delay (100);//SD.begin (SD_CS, SD_SCK_MHZ(10));}void loop() {while (true) {if (rfid.isCard()) {char msg;rfid.readCardSerial();sprintf (msg,"RFID: %i,%i,%i,%i,%i",rfid.serNum,rfid.serNum,rfid.serNum,rfid.serNum,rfid.serNum);Serial.println (msg);}}}As soon as I uncomment the "SD.begin() line", I can't no longer read any RFID tags. Even if I physically disconnect the microSD module. I tried to swap RFID and SDFat initialisation code, but same result.Also, if I remove the "delay()" after the "SPI.begin()", the reader is no longer workingI am using SDFat 1.0.5 from Bill Greiman and the RFID Library from Miguel Balboa (Jan, 2012).Thanks for any suggestion.

author: matseng
author_rank: Frequent Contributor
timestamp: March 16, 2018, 11:52:16 am
content: Both the SD card and the RFID module are using SPI so you either need to connect them to separate SPI busses on the Arduino (you probably will have to bitbang (software emulate) at least one of them), or you have to connect the CS/ChipSelect/Enable pins on both modules to extra GPIOs so you can select which module you want to talk to at the moment.

author: ggchab
author_rank: Frequent Contributor
timestamp: March 16, 2018, 01:06:34 pm
content: Thanks for your reply. But that's how this is already done: each module has its own select line. In addition, this is certainly not a hardware conflict since the RFID library stops working even when the microSD module is not physically connected

author: ggchab
author_rank: Frequent Contributor
timestamp: March 16, 2018, 05:22:35 pm
content: I captured the initialization sequence of the RFID module with/without a call to "SD.begin()" before "rfid.init():The 2 last packets are not sent if the SD module is initialized. That's normally done by this function in RFID.cpp:Code:void RFID::antennaOn(void){unsigned char temp;temp = readMFRC522(TxControlReg);if (!(temp & 0x03)){setBitMask(TxControlReg, 0x03);}}If "setBitMask()" is not called this is obviously because temp is not equal to 0x80 as returned by the RFID module on the bus.That means "SPI.transfer()" (used by "readMFRC522()") does no longer return valid data from the bus after the call the "SD.begin()" .I still have to discover why ...

author: ggchab
author_rank: Frequent Contributor
timestamp: March 16, 2018, 05:41:02 pm
content: Code:#define USE_STANDARD_SPI_LIBRARY 0must be changed toCode:#define USE_STANDARD_SPI_LIBRARY 1in file SdFatConfig.h