hybridfree/eevblog-posts huggingface dataset:
PIC24FJ128GA308 RTCC - Page 1
Forum section: electronics / general

author: YU7C
author_rank: Regular Contributor
timestamp: December 21, 2017, 12:24:31 am
content: Hi,I am working on the project which include PIC24FJ128GA308 and internal RTCC.There are a hundred examples on the web which explain how to use RTCC including Microchip documentation.I tried everything without success. In fact RTCC works and LED connected to RTC pins blinks every second, but I can't access to RTCC Value registers and change them.I ported a same code to the PIC24FJ64GA306 and there, it works fine.It must be something with the pointer for RTCC Value registers, but there is no problem with PIC24FJ64GA306 which i believe share the same core.Any ideas?Vojislav

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 21, 2017, 01:21:12 am
content: There is an unlocking sequence you have to follow to be able to write to RTCC registers on those PICs.It's documented only in assembly in the docs, but there is a builtin function in XC16 to do that properly from C. I think it's unfortunately poorly documented and you have to dig in the XC16 manual.Call:Code:__builtin_write_RTCWEN();before writing to RTCC registers. This function is the only reliable way of doing this, unless you develop strictly in assembly.Once you're done writing, you can execute:Code:RCFGCALbits.RTCWREN = 0;to lock access back.This sequence is intended to avoid unwanted modifications.

author: YU7C
author_rank: Regular Contributor
timestamp: December 21, 2017, 07:44:16 am
content: Thank you.But I tried that, even with sequences in assembler.And it works for PIC24FJ64GA306 but not for PIC24FJ128GA308 ??

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 21, 2017, 02:45:22 pm
content: Doesn't seem to be any erratum regarding this issue.Could you post a snippet of your code?
DALI TX opto should have greater CTR? - Page 1
Forum section: electronics / general

author: ocset
author_rank: Super Contributor
timestamp: December 06, 2017, 08:42:36 pm
content: Hello,Figure 5, page 3, of the following DALI application note (AN1465) shows optos being used to isolate both TX and RX DALI signals….AN1465 Application note:http://ww1.microchip.com/downloads/en/AppNotes/01465A.pdfThough surely, the TX opto should be a TCLT1009 (CTR of TCLT1009 = 300%) and not a TCLT1000 (CTR of TCLT1000 = 50%)?Also, surely the RX opto should be a TCLT1000, which it indeed is.The reason that the RX opto should be a TCLT1000 is because it has a lower capacitance seen at its emitter pin which means the rise time of the emitter can be quicker. Do you agree?TCLT100X opto datasheet:https://www.vishay.com/docs/83515/tclt1000.pdf

author: CJay
author_rank: Super Contributor
timestamp: December 06, 2017, 08:54:55 pm
content: DALI is only 1200BPS isn't it?Not at all convinced it's necessary for it to be faster, I'm transferring 19200 BPS logic level serial through two CNY25s, the only extra components are a couple of pull up resistors per opto.

author: dmills
author_rank: Super Contributor
timestamp: December 16, 2017, 05:45:36 pm
content: The usual problem with simple minded DALI is that the transmit edge is **overly fast** not too slow.Check the standard, but as I recall there was a limit on how fact the line should fall when you transmit.regards, Dan.
PLCLIB for Arduino- need help in understanding how to use with Servo library - Page 1
Forum section: electronics / general

author: IconicPCB
author_rank: Super Contributor
timestamp: December 07, 2017, 09:50:37 am
content: Anybody have any experience with the above libraries.Am having problems in driving Servo while using the PLC library.Any hints welcome... please....

author: ajb
author_rank: Super Contributor
timestamp: December 08, 2017, 06:50:32 am
content: It would help if you described what sorts of problems you're experiencing and what troubleshooting steps you've taken thus far. Also what hardware you're using--"Arduino" isn't terribly specific in that respect these days.As a shot in the dark, I would guess that the two libraries are trying to use the same timer(s).

author: IconicPCB
author_rank: Super Contributor
timestamp: December 08, 2017, 11:33:33 am
content: I am trying to use PLClibrary to resolve some control issues and the result of the decisions leaves me with three options each calling for a positional servo outcome.PLC library does not of itself offer analog variable processing other than analogue read , PWM and Servo outputs.All would be fine if only a single value needed to be passed to the Servo library ...however making a selection of one of three variables does not seem possible precluding a degree of automation.PLC library relies on scanVariable whose content is valid immediately after the evaluation of the "rung".I have tried saving content of the scanVariable immediately post the evaluation with no joy,

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: December 10, 2017, 07:11:42 am
content: Quote from: IconicPCB on December 08, 2017, 11:33:33 amservo.write() takes a single parameter - the angle to set the servo to. What do your three variables contain, and why do you need to 'make a selection of one' of them?

author: IconicPCB
author_rank: Super Contributor
timestamp: December 10, 2017, 07:42:09 am
content: The three variables each contain a servo position.The position is selected on outcome of combinations calculated by PLC library (https://github.com/wditch/plcLib)Unfortunately the original websitewww.electronics-micros.comhas gone belly up precluding me form reaching the author of the library.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: December 10, 2017, 07:10:34 pm
content: Quote from: IconicPCB on December 10, 2017, 07:42:09 amStill not clear. How do you choose which position to use? Rather than continuing this guessing game, post your code so we can see what you are trying to do.

author: phil from seattle
author_rank: Super Contributor
timestamp: December 10, 2017, 09:55:54 pm
content: I second the point about lack of clarity. Have you looked at the PLCLIB source code? You have it on your machine.

author: IconicPCB
author_rank: Super Contributor
timestamp: December 11, 2017, 01:02:29 pm
content: Apologies for no response..day has been full and i am yet to hit the sack.I hope to be able to get back to you with a clearer statement and sample code..
Cortex M7 debugging bug - Page 1
Forum section: electronics / general

author: daqq
author_rank: Super Contributor
timestamp: December 08, 2017, 07:39:27 am
content: So, there's a bug in the debugging of the Cortex M7 core... it's a bug in the silicon, in the ARM core actually.http://www.keil.com/support/docs/3778.htmI'm now strugling with an STM32F7 device... and it's pretty annoying.I'd have assumed that they test for stuff like this. This isn't exactly a subtle bug that shows its head when the phase of the moon is right.

author: Jeroen3
author_rank: Super Contributor
timestamp: December 08, 2017, 07:43:32 am
content: Can you isolate the software that you want to step trough?I've never gotten any usable results from debugging in full code. Since the surrounding real world does not halt.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 08, 2017, 08:08:33 am
content: Same as Jeroen3, I found out that stepping through code in debugger is helpful so rarely that I stopped doing it entirely.I mostly need that kind of "debugging" when accessing with outside world (or with complex time-dependent accesses with peripherals, like DMA), which can't be halted. A typical approach I use is something like this:Code:original_code()uint32_t tmp1 = INTERESTING_REGISTER;more_original_code()uint32_t tmp2 = INTERESTING_REGISTER;more_original_code()....when you have time:printf("%x, %x\n", tmp1, tmp2);Or, for example, just a few days ago I debugged strange issues with DMA-driven I2C and DCMI (camera interface) interfacing with a CMOS sensor, and did it like this:Code:uint32_t snapshots;start_i2c_transfer_here();for(int i=0; i<1000; i++){snapshots = interesting register, pin state, whatever;blink_io_pin_to_sync_the_datatrace_with_oscilloscope}print_snapshots_here();This gives minimal interference and allows you to fine tune what you gather and when. Of course slower to write than just looking at the debugger screen, but with this kind of creative approach, you can basically solve all the issues that come to you, whereas the debugger always has serious limits in regards to application timing.

author: nctnico
author_rank: Super Contributor
timestamp: December 09, 2017, 01:23:58 am
content: I do the same as Siwastaja and Jeroen3 when it comes to on-target debugging or getting some real data from a device. Usually I debug/unit test code on a PC first because in that case I can run all kinds of scenarios and I'm not limited by a debug interface which may or may not work for various reasons.

author: Jeroen3
author_rank: Super Contributor
timestamp: December 09, 2017, 01:52:07 pm
content: STM studio is helpful. Although full of traps for young players.It reads memory as fast as it’s allowed, but it’s doing this at anirregular interval.While sometimes helping you tackle a bug, it can also send you hunting for ghosts if you’re not paying attention.It also can’t read 64 bit values.
Thoughts on Energia - Arduino IDE for TI  MSP430 boards - Page 1
Forum section: electronics / general

author: ez24
author_rank: Super Contributor
timestamp: December 08, 2017, 08:31:27 pm
content: Has anyone tried Energia for MSP430 boards? Energia is an Arduino compatible IDE for TI MSP430.I have not tried it, I am starting to learn Arduino so I will start with the real IDE first.http://energia.nu/thanks

author: mtdoc
author_rank: Super Contributor
timestamp: December 08, 2017, 09:56:58 pm
content: Energia brings all the advantages and disadvantages of the Arduino IDE to TIs inexpensive MSP430 and ARM dev boards.Personally, I like it for quick projects - though I’m sure the hardcore embedded developers will pooh pooh it...

author: paal
author_rank: Newbie
timestamp: December 09, 2017, 08:24:50 am
content: I've used it quite a bit, and it has it's advantages. One of them being that energia sketches can be imported into code composer studio (free from TI) so that you can debug your programs properly (could be that the Arduino/AVR has the similar toolchain, didn't look for it, but it worked very well with MSP).Also, the MSP's are extremely 'project friendly' in that they run off 2 x AA batteries, down to 2.1V or thereabouts (*), are very low power and runs without a crystal.Could be that Arduino offer similar advantages, I'm sure the experts will be able to chime in.(*) Such low supply voltages on the MSP430 requires a lower clock frequency than what the standard Energia setup uses, but it's very simple to add a piece of code inline in your sketch that reduce the frequency to e.g. 8MHz, so that you are witing 'SOA'.
STM32F429 eeprom emulation and how to protect flash - Page 1
Forum section: electronics / general

author: trevwhite
author_rank: Frequent Contributor
timestamp: December 13, 2017, 12:25:16 am
content: HII am using the STM32F4 eeprom emulation library but I think the compiler is not aware of the flash being used for eeprom and so code is being placed in the flash in the same area as being used for eeprom.I am using Atollic and at present I do not know how to tell the compiler/linker to not use FLASH_Sector_2 and Flash_Sector_3. Any ideas?Trev

author: krho
author_rank: Regular Contributor
timestamp: December 13, 2017, 05:37:45 am
content: You have to change the linker script. In the linker script in there you should add some "reserved" section which starts at the 0x80000000 + 1st sector size and lasts till the end of 3th sector. This should be enough info for you to google it out. Or you can wait for one that knows how to do it out of their head.
Analog Input Issue - Page 1
Forum section: electronics / general

author: Etesla
author_rank: Regular Contributor
timestamp: December 05, 2017, 03:51:19 am
content: To be clear, I think this is a hardware issue. I am trying to read the value of a 10k pot using a pic 12f683 microcontroller.When the pot is connected in such a way that the two 'outside' legs are connected to +5v and ground, and the middle leg is connected to pin 3 on the 12f683:I am able to read the input from the pot with no problem using the microcontroller, however the voltage measured from the middle of the pot to ground (via a multimeter) does not change in a linear way as it is turned. For example, if I turn the pot say, 10 degrees, the voltage goes up from 0v to 2.5v. The voltage then stays around 2.5v until the pot is turned to about 170 degrees, when it sharply rises again to 5v.When the pot's middle pin is floating:The multimeter reading between the middle pin and ground reads as expected. turning the pot results in a nice, linear increase in voltage as expected.Other Notes:I also noticed that when using a pot with a significantly lower resistance (a 500 ohm pot), the issue was mostly resolved and the pot read as expected regardless of whether or not it was connected to the microcontroller. This is my current solution, but I suspect there is a better one.All this leads me to believe that the input pin on the microcontroller is not a high impedance input. I am not sure how this is possible, and my multimeter reads very high resistance from pin 3 on the 12f683 to ground, and I thought all inputs on a microcontroller would have at least like a megaohm of input impedance...Any ideas as to how or why this is happening???Here's my code written in mikroC. All it is supposed to do is flash a led at a rate proportional to the voltage read on pin 3... It works fine except for the voltage coming off of the pot issue as described above. :void newDelay(int t) {while(t > 0) {Delay_ms(1);t --;}}int readPot() {int i = 0;ADCON0.ADON = 1;for(i = 0; i < 1000; i ++) {}ADCON0.B1 = 1;while(ADCON0.B1) {}ADCON0.ADON = 0;return ADRESL + (ADRESH * 256);}void b(int timer) {GPIO.GP2 = 1;newDelay(timer);GPIO.GP2 = 0;newDelay(timer);}void main() {CMCON0 = 0x07;TRISIO.GP2 = 0;TRISIO.GP4 = 1;ANSEL = 0b00001000;ADCON0 = 0b10001100;while(1) {b(readPot() + 100);}}

author: mikerj
author_rank: Super Contributor
timestamp: December 05, 2017, 12:54:14 pm
content: What value do you have the configuration fuse set to, specifically the FOSC bits (2:0)? If you inadvertently set this to INTOSC (101) instead of INTOSCIO (100), then you'd get the system clock being output on GP4, which would give you an average voltage of about 2.5v on that pin.

author: Etesla
author_rank: Regular Contributor
timestamp: December 05, 2017, 03:00:57 pm
content: That was the issue. Thank you so much.

author: mikerj
author_rank: Super Contributor
timestamp: December 06, 2017, 08:55:43 am
content: Glad it was a simple fix
Need ISL29029 c driver code - Page 1
Forum section: electronics / general

author: muthukural001
author_rank: Regular Contributor
timestamp: December 05, 2017, 12:19:22 pm
content: Hello all,I am working on ISL29029. I have successfully established I2C communication between MCU and ISL29029, and can read and write the registers . Now I am looking for sample C code of ISL29029. Please suggest..Regards,Muthu
have you done projects on touchgfx? - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: October 31, 2017, 02:33:39 pm
content: Hi,I have seen it in the i.MX RT series instruction videos, it seems quite a nice tool, I have done several projects based on emwin from segger, but it seems that this touchgfx is more capable, I wonder if someone out there have use it in his projects, what are your ideas? does the porting a painful process? how does it compare to emwin? is it more cpu and memory intensive than emwin? also is there any plan for being able to use it for free like emwin for ST and NXP parts?

author: krho
author_rank: Regular Contributor
timestamp: November 01, 2017, 09:04:46 am
content: I can't compare it to other but what I can tell you is that you need memory mapped QSPI flash for it. Or enough ram for resources. Everything except the text and effects when screen changing is prerendered bitmaps. All bitmaps including font glyphs must be in format that the "graphic core" inside the CPU you are targeting understands.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 01, 2017, 12:50:46 pm
content: Thanks, have you use it in your own projects? is it worth the effort?

author: krho
author_rank: Regular Contributor
timestamp: November 01, 2017, 06:38:29 pm
content: No we haven't used it. We compiled the demo for stm32f429 demo board and played with the Windows demos changed some small things just so we could see how it behaves. Then we decided that this is not for us as we cannot afford so many screens prerendered. Then we put that specific project on hold for about a year.

author: ebclr
author_rank: Super Contributor
timestamp: November 02, 2017, 03:27:03 am
content: Make a try on this other tool, It's simplerDownside only few graphics controllerhttps://shop.mikroe.com/visual-tft

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 02, 2017, 11:20:47 am
content: Thanks, krho was it smooth on the hardware? is'nt it in C++? why do you say it was hard?

author: krho
author_rank: Regular Contributor
timestamp: November 04, 2017, 08:32:22 am
content: It was smooth on hardware as long as Chrom-ART Accelerator was used. Otherwise the CPU time was spent on the rendering.I didn't say it was hard. I just said that you need external QSPI in memory mapped mode for your screens. Unfortunately The CPU we wanted to use only has one QSPI and we needed that one available for writing. (which cannot be done if qspi is memory mapped)

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: December 06, 2017, 08:41:42 am
content: I have saw the new webinar with STM32FL parts right now, the tool looks definitely promising and worth a try. The only hard part would be how easily is it possible to test it in our own real hardwareand if we have the free options like emwin for ST and NXP parts it would be living in heaven
Atmel XMega CPU @ 32MHz -> PLL or RC oscillator? - Page 1
Forum section: electronics / general

author: bernroth
author_rank: Regular Contributor
timestamp: December 04, 2017, 06:14:27 am
content: Hello folks!Atmel XMega controllers have internally a 32MHz RC oscillator and a PLL.If the CPU shall only run @ 32MHz, would you choose RC or PLL?PLL clock source is internal (RC) as well.Is there a good reason to actually use the PLL?From my point of view there is none.I can switch it off and save some power.Is there maybe something I have overseen?Is the PLL more stable when it comes to external noise?Temperature stability should make no difference at all as it would affect the 32 MHz RC as well as the RC ocsillator for PLL.Background: I am doing some firmware for a finished product which does (unfortunately) not have an external crystal for the PLL. This would be my preferred choice.The firmware works well with 32MHz RC as well as with 32MHz PLL.Any feedback welcome, thanks!Best regards,Bernhard

author: krho
author_rank: Regular Contributor
timestamp: December 05, 2017, 05:58:40 am
content: afair when you run it with pll you can synchronize everything against internal 32kHz RC and have very precise clock
Multi module systems communicate with data bus - VHDL - Page 1
Forum section: electronics / general

author: dr.cnet
author_rank: Newbie
timestamp: December 05, 2017, 05:32:22 am
content: Dear developer,I am a newbie member here and would appreciate it if you guide me through this problem.I am learning VHDL with a book titled: "Structured Logic Design with VHDL, J R. Armstrong" which I think its some kind of difficult for me to solve the problems by myself.I couldn't solve this one and now need help.Thanks.PS: Question attached.
Did Tracealyzer remove the free edition? - Page 1
Forum section: electronics / general

author: WillHuang
author_rank: Contributor
timestamp: December 04, 2017, 03:43:48 am
content: I'm a hobbyist and a few months ago, I was playing with freeRTOS + tracealyzer. I absolutely loved the continuous streaming that Tracealyzer provided, although I believe you could only record data for a few minutes.Recently, I reformatted my computer and had to reinstall tracealyzer. To my astonishment, when I opened tracealyzer, the free edition button is no longer there! So did they remove this feature for us hobbyists?

author: mac.6
author_rank: Regular Contributor
timestamp: December 04, 2017, 11:12:27 am
content: Licensing page only refs purchased and academic licenses. So I guess your out of luck.If you have a JLink you can use systemview which is free.

author: WillHuang
author_rank: Contributor
timestamp: December 05, 2017, 05:07:24 am
content: Thanks! I just got systemview going and so far it is amazing!
STM32 with lwip and cubemx - Page 1
Forum section: electronics / general

author: Gibson486
author_rank: Frequent Contributor
timestamp: December 20, 2017, 05:12:07 pm
content: Anyone have a good example? I am trying to make sense of this from the examples ST gives, but they give little guidance. Do you send data with just the lwip commands? I am confused on how it relates to theethernetif_input(&gnetif);function that it leaves for you.
LPC4337 Won't debug most times!!! |O |O |O |O - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 20, 2017, 02:57:42 pm
content: Hi,I have a board that I can program all the times and the program works fine, but most of the times I can not debug the code!some times I can debug the boardI had to be able to debug the board to be able to continue to develop the software, do you have any Idea what might be wrong? I have j-link and ulink2, and have similar issues with both of them

author: ehughes
author_rank: Frequent Contributor
timestamp: November 27, 2017, 03:32:09 am
content: Can you share your schematic?What is your tool chain?Are you trying to debug the M4 or M0 core?

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 27, 2017, 06:17:40 am
content: The problem is now solved!the problem was that the Keil project file was corrupted in a very weird situation that It could program the chip, but not debug it!!! I simply create another project and Import all the project files

author: Jeroen3
author_rank: Super Contributor
timestamp: November 27, 2017, 08:21:46 am
content: What version of uVision are you using?

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 27, 2017, 10:38:48 am
content: V5.24a
MIPI DSI Question (Pronunciation of) - Page 1
Forum section: electronics / general

author: mperativ
author_rank: Newbie
timestamp: November 16, 2017, 06:10:33 am
content: So, how is the MIPI DSI specification referred to in terms of pronunciation?Is it "My Pie" or "Mippy"? I want to avoidconversations like the first time you learned you were saying hysteresis and quiescent incorrectly.

author: Berni
author_rank: Super Contributor
timestamp: November 16, 2017, 06:14:40 am
content: I always used the "Mippy" version. Tho i would guess that everyone reads it differently just like I2C.Perhaps the pronunciation should be part of the MIPI standard. If you pay the few grand to get access to the full spec you might as well also get to know how to say it.

author: Scrts
author_rank: Frequent Contributor
timestamp: November 16, 2017, 07:53:09 pm
content: Quote from: Berni on November 16, 2017, 06:14:40 am"Mippy" is the common industry standard from my experience.

author: Buriedcode
author_rank: Super Contributor
timestamp: November 18, 2017, 09:23:09 pm
content: Never understood the fascination with pronouncing acronyms phonetically. I don't think I've heard someone call the CAI 'keeya' or ATM 'atom'. And 'gooey' for GUI seems to be only used by those who don't develop them..

author: Puffin
author_rank: Unknown
timestamp: November 21, 2017, 11:14:30 am
content: Quote from: Buriedcode on November 18, 2017, 09:23:09 pmI've been developing GUIs for over 20 years I've very rarely heard anyone prononunce GUI any other way than "gooey" ! Maybe it's down to the locality?
spartan6 lx9 interface with adc  (AD9238) - Page 1
Forum section: electronics / general

author: alireza7
author_rank: Regular Contributor
timestamp: November 19, 2017, 09:37:20 am
content: hii want to clock a AD9238-65 which is a 65mhz adc with a spartan6 XC6SLX9-2TQG144I.AD9238-65 is a dual channel adc. if i clock these pins ADC_MUX and ADC_CLKA and ADC_CLKB with the same signal i can read both channel A and channel B on single portA and there is no need to connect port B of the adc to the fpga and use less IO pins of fpga.my question is whether i can connect a single pin of fpga to these there pins of adc ? is a single pin of fpga able to drive these pins in 65mhz ? or i need some buffer between?how can i figure it out? i checked spartan6 datasheets for DC AC Charactristic of io pins but it was confusing for me and i couldn't figure it out.

author: alireza7
author_rank: Regular Contributor
timestamp: November 19, 2017, 09:54:59 am
content: here is the input characteristic of adc:

author: Someone
author_rank: Super Contributor
timestamp: November 19, 2017, 11:49:12 pm
content: Quote from: alireza7 on November 19, 2017, 09:37:20 amFirst order estimate is from the impedance of the pins you will drive, compared to the current capabilities of the drive pin. Then you can get more accurate with simulations:https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/device-models/hspice-and-eldo-models/spartan-series-fpgas.htmlhttps://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/device-models/ibis-models/spartan-series-fpgas.html

author: nctnico
author_rank: Super Contributor
timestamp: November 20, 2017, 12:36:17 am
content: AFAIK you can set Xilinx pins to 12mA drive current. You'll need to charge and discharge the capacitance of the pins and traces fast enough. You can make a ball-park estimate by modelling the pin as a constant current source and the load as a capacitor. Say you have a total capacitance of 8pf (4pf input and 4pf trace) and you have a difference of 3.3V then 12mA will charge/discharge that in 2.2ns t=(C* voltage swing)/Idrive. 65MHz means a 15.3ns period so 7.7ns high and 7.7ns low. The clock net will need some termination (33 Ohm in series at the FPGA pin for example) to prevent excessive ringing.

author: simmconn
author_rank: Regular Contributor
timestamp: November 20, 2017, 05:49:26 am
content: Spartan6 has no problem driving LVCMOS at 65MHz. I can even use 6mA drive strength without termination for two loads if the trace length is short enough.Since OP is thinking about DDR mode, 65MHz is about the frequency where the round trip delay (IO pad output delay + input delay + 2x PCB trace delay) starts to play a role here. You'll probably be split among1) using the feedback clock from the clock output pad to latch the input data,2) use a separate clock feedback pin to latch the input data or3) even fancier clock delay compensation schemes (such as adjustable delay from DCM).
PIC18F Bootloader - any recommendations? - Page 1
Forum section: electronics / general

author: voltsandjolts
author_rank: Unknown
timestamp: November 17, 2017, 08:46:32 am
content: Using PIC18F for first time in a one off* project (18F46K40), so I'm just finding my way around.XC8 looks reasonably solid.I see the Microchip MCC can generate a bootloader but I haven't tried it yet - should I pursue this or is there something better out there?Edit:* When I say one off, I mean one design but hundreds of boards.

author: Ian.M
author_rank: Super Contributor
timestamp: November 17, 2017, 10:36:52 am
content: Don't bother for a one-off unless its going to be difficult to get to the board with an ICSP lead. A bootloader introduces unnecessary complexity, and unless carefully implemented, can significantly decrease reliability. Also keeping the matching PC app current so it runs on new OS versions is a PITA.

author: voltsandjolts
author_rank: Unknown
timestamp: November 17, 2017, 10:46:47 am
content: Wise words indeed but unfortunately mechanical assembly and client dictate requirement for in situ firmware updates over UART.

author: jaromir
author_rank: Unknown
timestamp: November 17, 2017, 11:01:33 am
content: There was exactly one occasion when Ineededgeneric UART bootloader in my project (though I wrote at least dozen of application-specific FLASH loaders for PIC devices), I used this onehttps://picbootloader.com/for PIC18F2420. Not sure how much work is needed to port it to 'K40, but it will not be probably very complicated task.

author: voltsandjolts
author_rank: Unknown
timestamp: November 17, 2017, 02:14:49 pm
content: Thanks, I'll look into that.I see the same guy hashttps://www.ds30loader.comwhich offers commercial support.

author: jc101
author_rank: Frequent Contributor
timestamp: November 17, 2017, 02:34:30 pm
content: Quote from: voltsandjolts on November 17, 2017, 02:14:49 pmThat chap does indeed offer great support for his boot loaders, I'd recommend them if you didn't want to roll your own.
Working on ws2811(DMA to GPIO) - Page 1
Forum section: electronics / general

author: alizone
author_rank: Newbie
timestamp: November 16, 2017, 12:30:47 pm
content: Hi everyone,This is my first post. I hope I will more and more post because I want to learn a lot of things about embedded.So, I am working on addressable led which has ws2811 ic and I want to write library about it and I am using the Hal library. I am trying now. But I didn't understand something.I have to send data DMA to peripheral(GPIO). I know I can set this std library with below.DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&GPIOA->ODR;DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)WS2812_IO_High;

author: thm_w
author_rank: Super Contributor
timestamp: November 16, 2017, 09:09:06 pm
content: Memory base address is a pointer to the memory location of data you want to send. Is WS2812_IO_High an array containing pixel data?Maybe you can get some ideas from existing projects:http://www.martinhubacek.cz/arm/improved-stm32-ws2812b-libraryhttps://github.com/g4lvanix/0xWS2812http://fabioangeletti.altervista.org/blog/stm32-interface-ws2812b/?doing_wp_cron=1510866007.6318340301513671875000
ESP32 deep sleep. - Page 1
Forum section: electronics / general

author: hamster_nz
author_rank: Super Contributor
timestamp: November 15, 2017, 09:16:08 am
content: After a tweet from John at Expressif, I finally got to prove to myself that ESP32 can sleep at <7 uA - on a WeMos LoLin32 board I was getting 890uA.After downloading my test code to the flash, I lifted the (not that great) 3V3 regulator and powered it from a bench supply.about 28mA when awake, and < 0.1mA when asleep.I had rigged up a toggle switch so I could switch in a uA meter while it was asleep, and the results are in - 6.22uA while asleep, and waking up like clockwork.Code as used (sorry, it still has some debugging of the power registers in there)Code:... header files ...#define MHZ (1000000)const static char *TAG = "deepsleep";void app_main(void){ESP_ERROR_CHECK( nvs_flash_init() );while(1) {ESP_LOGI(TAG, "Awake\n");WRITE_PERI_REG(RTC_CNTL_PWC_REG, 0x00120240);ESP_LOGI(TAG, "RTC_CNTL_OPTIONS0_REG 0x%08x", READ_PERI_REG(RTC_CNTL_OPTIONS0_REG));ESP_LOGI(TAG, "RTC_CNTL_ANA_CONF_REG 0x%08x", READ_PERI_REG(RTC_CNTL_ANA_CONF_REG));ESP_LOGI(TAG, "RTC_CNTL_PWC_REG 0x%08x", READ_PERI_REG(RTC_CNTL_PWC_REG));ESP_LOGI(TAG, "RTC_CNTL_DIG_PWC_REG 0x%08x", READ_PERI_REG(RTC_CNTL_DIG_PWC_REG));sleep(2);ESP_LOGI(TAG, "Entering deep sleep\n");sleep(1);esp_deep_sleep(15*MHZ);ESP_LOGI(TAG, "Sleep failed\n");sleep(1);}}
PIC32MZ DA GLCD + EBI/PMP - Page 1
Forum section: electronics / general

author: mperativ
author_rank: Newbie
timestamp: November 09, 2017, 05:47:33 am
content: I am currently working on a project involving a TFT LCD display. I have chosen to use the PIC32MZ2064DAH176, and will be using all pins of the GLCD peripheral on this chip to support the display. I would like to be able to use the EBI for additional memory support, but because of the GLCD, a good portion of the EBI pins are already in use. However, the lower 8 bits of EBI address and data pins are still available, as well as the OE, RP, and WE pins. These remaining pins are enough to support my application, but I was wondering if these free pins (and the EBI module itself) can even be used when the GLCD is enabled.A more direct version of my question is: can the GLCD and EBI modules both be enabled, or is it one or the other? According to the data sheet, the answer is no... ish. Section 26 (page 391) of the PIC32MZ DA datasheet states "When using the EBI module, Graphics LCD Controller (GLDC) functionality is not available, as most of the I/O between the EBI module and the GLCD is shared."While it seems as if I already have the answer, I don't. Since you can setup the EBI to use only the lower bytes of both address and data pins and function without any chip selects, the remaining EBI pins are not multiplexed to the GLCD. I do not currently have hardware to use to answer this question and was wondering if anybody has successfully used both the GLCD and EBI (simultaneously) on this (or similar) PIC32.Thank you.

author: Arjen_Arg
author_rank: Contributor
timestamp: November 18, 2017, 05:44:58 pm
content: While I don't have the answer to your question, and I hope someone shows up with it, I have found that MPLAB Harmony or Code Configurator are very useful to test these things out. If they let you set it up and create the code, it often means that it's allowed. It's not guaranteed, but in lack of a better answer, that might help you test out the idea.
Question about AT Commands - Page 1
Forum section: electronics / general

author: WillHuang
author_rank: Contributor
timestamp: November 14, 2017, 01:22:08 pm
content: I'm very new to IoT and implementing IoT based projects, but I noticed that a lot of wireless modules (bluetooth, ble, wifi, cellular, ect..) usually contains user-friendly interfaces via the AT commands. My question is, is it usually the norm for companies to implement IoT solutions using AT Commands?

author: kkessler
author_rank: Regular Contributor
timestamp: November 14, 2017, 03:39:07 pm
content: I would say that commercial product would not go the AT command set route. The ESP8622 comes with firmware that implements AT Commands to make it easy to use with the Arduino, but that is like a VW Bug dragging a Ferrari along to listen to the radio. The processor in the ESP8266 is far more powerful than the Atmel in the Arduino. I've also run across Bluetooth modules implemented in the same way, but a commercial product would go with something like one of the Nordic Semiconductor's NRF51822, with their ARM core. In general, when you are using the AT Command set, you are using 2 microcontrollers (1 running the AT Commands and one running your code), and it is cheaper and simpler to just code directly on the uC in the radio chip, and in that case you are just making library calls to control the radio, which look nothing like the AT commands.
ARM Noob Question - Page 1
Forum section: electronics / general

author: kfnight
author_rank: Regular Contributor
timestamp: November 11, 2017, 12:49:44 am
content: Suppose there is a memory-mapped peripheral that I want to read from or write to using LDR/STR. The peripheral is an APB slave, if that matters. Do the LDR/STR instructions typically block program execution until the read/write operation successfully completes, or does it return immediately and I have to check a status bit to see when the read/write completes?Thanks

author: ataradov
author_rank: Super Contributor
timestamp: November 11, 2017, 03:06:09 am
content: That depends a lot on the actual core and implementation. Most implementations have at least write buffers. Reads will block execution, but may or may not block the bus entirely.And no, there will be no status bits, it will just work as you expect. Except writes may happen much later in time than the actual instruction. There are synchronization barrier instructions that help dealing with this.And some devices (like Atmel/Microchip SAM Dxx) will have specially designed peripherals that themselves will or may need synchronization, but the actual bus transfer happens as usual, peripheral just takes time to prepare the result, and you have to actively poll for it.

author: rstofer
author_rank: Super Contributor
timestamp: November 11, 2017, 04:39:11 pm
content: The STR will probably be buffered with interlocks such that the next instruction can read the same port and get the new value. This isn't a big issue because the data that went to the port is still in a register somewhere. Just copy it and move on.The LDR has to wait for the data to traverse the bus. As a programmer you would expect to be able to read the peripheral and operate on the results with the next instruction. As a CPU designer, you know this won't work without a pipeline stall so you may have to delay the CPU or begin executing instructions out-of-order (or insert NOPs).As a compiler writer, you know there will be pipeline stalls so you emit code in a sequence that optimizes throughput.The application programmer may know about these issues but just sits back and lets the compiler writers work with the CPU designers. Unless the errata says otherwise, there should be no glitches caused by any sequence of instructions.
SAMD09 supports for boot over I2C ? - Page 1
Forum section: electronics / general

author: muthukural001
author_rank: Regular Contributor
timestamp: November 06, 2017, 10:10:53 am
content: Hello All,I am going to start a project with SAMD09 microcontroller.Before going for fabrication, I want to know whether it supports Boot from external EEPROM which is connected on I2C or not. Please let me know....Regards,Muthu

author: mikerj
author_rank: Super Contributor
timestamp: November 06, 2017, 10:33:50 am
content: There is no built in bootloader, but it does offer support for a custom bootloader. If you need this functionality you would have to write the code and locate it in the memory area defined for bootloader operation, and set the configuration fuses to protect your bootloader.

author: muthukural001
author_rank: Regular Contributor
timestamp: November 06, 2017, 11:18:48 am
content: Hi mikerj,Understood. But, I don't know that how to load external EEPROM with our application .hex?. Is they are using any PC software to write .hex file to External EEPROM?.Once this has done , I can read that .hex from External EEPROM in Bootlaoder mode and write it to the program memory of the Microcontroller.Regards,Muthu

author: ataradov
author_rank: Super Contributor
timestamp: November 06, 2017, 05:21:15 pm
content: I'm not aware of any bootloader that will do exactly this. But there are examples of bootloaders out there, you just need to adopt them to your needs.Start from writing a code that reads external EEPROM. Samples of that code and bootlaoders are available on my GitHub.You may want to switch from hex to just plain binary, this will make your life simpler.

author: WillHuang
author_rank: Contributor
timestamp: November 07, 2017, 03:59:35 am
content: I don't think there is a way to DIRECTLY boot from the external eeprom as the uC needs to know a valid starting address of the reset vector. However, what you can do is have the bootloader copy the image from the EEPROM to the uC's memory space and then run the image from there.
PIC - Use of 'ifdef' directive - Page 1
Forum section: electronics / general

author: SparkyChris
author_rank: Newbie
timestamp: November 03, 2017, 01:48:48 pm
content: Hello Everyone,I'm hoping one of you smart people might be able to help my understanding on something.I have been given some code to familiarize myself with, and I'm a bit confused with the use of the 'setdef' as shown below, can anyone shed some light on what its doing?.This is code written in MBLAB IDE for a PIC18F452Code:ifdef #GaugeResultLine1setdef @GaugeResultLine1, #GaugeResultLine1endifMany Thanks,Chris

author: cv007
author_rank: Frequent Contributor
timestamp: November 03, 2017, 02:38:15 pm
content: 'setdef' is most likely a macro (in the same file, or include file)probably something like-setdef macro a,b#define a bendmso, basically- if #GaugeResultLine1 is defined, also define @GaugeResultLine1 to be the same

author: SparkyChris
author_rank: Newbie
timestamp: November 03, 2017, 02:58:06 pm
content: Thanks, that was spot on. I searched for, and found the macro inside an include file...and a few more which explains a few others!
Further to earlier discussions about alternative HDLs - Page 1
Forum section: electronics / general

author: Cerebus
author_rank: Super Contributor
timestamp: November 02, 2017, 12:04:34 am
content: A while back a discussion sprung up about alternative HDLs some of which were, !horror!, Python based.Anybody who was interested by that might be interested inthispost on Bunnie Huang's blog.

author: ebclr
author_rank: Super Contributor
timestamp: November 02, 2017, 02:58:12 am
content: Let's try Litex

author: hamster_nz
author_rank: Super Contributor
timestamp: November 02, 2017, 09:07:03 am
content: From the blog post:QuoteI wonder what that bloat is made up of? I'm picking that the Vivado design has "all singing, all dancing" IP blocks which maybe have their own processor in them, and that LiteX has a minimal functional design.

author: Someone
author_rank: Super Contributor
timestamp: November 02, 2017, 10:47:32 am
content: Quote from: hamster_nz on November 02, 2017, 09:07:03 amIt could just be the massively reduced utilisation and they're counting the place+route time into the "runtime" which would be lengthy above 80% utilisation and very fast at 20%. It would be interesting to see the actual cores chosen and their respective capabilities, there is likely a lot more to the headline grabbing figures than is presented in that short blog post.

author: NorthGuy
author_rank: Super Contributor
timestamp: November 02, 2017, 08:42:49 pm
content: Looks like they use custom IPs which are more efficient that Xilinx's. That's all. Has nothing to do with Vivado, Python, development flow, or anything of that sort.Placing and routing (which is still done by Vivado) will be much slower at 80% utilization than at 20%, hence the difference in run times (although from the article it is impossible to tell if P&R is even included in the estimates).
Unfiltered PowerLine needs to be improved - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: November 02, 2017, 04:29:50 pm
content: so, I am playing with an old board which eats 2.5A at 5V(1), and ... it seems to have a poor power line input, pretty unfiltered.I am experimenting glitches and strange effects when I provide the 5V power, and the board needs to be reset otherwise it stays haltedI am not expert of power lines, and power filters, but I am open to suggestions, advice, tricks ...(1) I am usingthis50Watt Switching unit by VELLEMANedit:wrong picture's link fixed!

author: Nusa
author_rank: Super Contributor
timestamp: November 02, 2017, 04:50:05 pm
content: Which is it? The 75 watt 24 volt Mean Well supply in your picture, or the 50 watt 5 volt Velleman supply in the link? They're not the same thing.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 02, 2017, 05:07:03 pm
content: Says CISPR22 emissions, so it can't be too bad*.*But it might pay to ask themhowthey performed that test. Was it plugged in, attached to a long cable, with nominal load on it? Or just sitting there at the end of a plug with no load at all? Who knows.'Cuz it makes a difference, and it could happen...Paranoia question: can you prove it is the power supply? Do this by:1. Replace the power supply with a battery of similar voltage and current capability. This ensures your circuit is operating, but not grounded.2. Connect up the power supply's ground and neutral, but leave the hot disconnected. Connect its output negative to your circuit. Any change?3. Remove the battery and connect the power supply positive and hot, powering it up. Any change?Common mode noise is pernicious and difficult to track until you understand its equivalent circuit. It can very well be that other attached loads or supplies or instruments (especially scopes, which are usually grounded) are making things worse: not by their own noise, necessarily, but by providing a ground path for noise to flow down.Tim

author: legacy
author_rank: Super Contributor
timestamp: November 02, 2017, 05:13:34 pm
content: Quote from: Nusa on November 02, 2017, 04:50:05 pm50Watt Switching unit by VELLEMAN

author: legacy
author_rank: Super Contributor
timestamp: November 02, 2017, 05:16:03 pm
content: Quote from: T3sl4co1l on November 02, 2017, 05:07:03 pmindeed'Cuz it makes a difference, and it could happen...Quote from: T3sl4co1l on November 02, 2017, 05:07:03 pmYup, I will
Multiplexing a 7seg display with an ATtiny167 - Page 1
Forum section: electronics / general

author: Random Model Maker
author_rank: Regular Contributor
timestamp: October 31, 2017, 10:34:35 pm
content: Hello,I am realising a small voltage and temperature control circuit in another project. As I am not very good at programming nor do I really like it, I prototyped the circuit with an Arduino Uno and then programmed it onto the ATtiny167 via ISP.On the breadboard with the Arduino Uno, the circuit works perfectly well, but on the actual PCB I did, the unused segments of the display glow dimly and make it hard to read. I have tried varying the multiplexing times, but so far, that did not help and I am a bit stuck.I cannot see why this should be a fault of the code, when it is working on the Uno just fine. Maybe some mistake in the schematic, why I could not go from the Uno directly to the Microcontroller?The display time for each digit is 5ms. You an find a schematic and my code in the attachments.

author: cv007
author_rank: Frequent Contributor
timestamp: October 31, 2017, 10:42:46 pm
content: Code:void callupDigit1(int y) {//Digit 1digitalWrite(disp1,HIGH);digitalWrite(disp2,LOW);digitalWrite(disp3,LOW);digitalWrite(segDP,HIGH);display(y);}You are changing the digit drivers while the segments are still set. Turn off all drivers, change the segments, turn on the needed driver.What you see, I call it 'ghosting' .Code:void callupDigit1(int y) {//Digit 1digitalWrite(disp1,LOW); //offdigitalWrite(disp2,LOW); //offdigitalWrite(disp3,LOW); //offdigitalWrite(segDP,HIGH); //off (is a segment)display(y); //set new segmentsdigitalWrite(disp1,HIGH); //now turn on digit}I don't know that it will solve your problem, but it will certainly be better.If you think about what is happening in 'slow motion', it will make sense-digit1 is displaying a number 5now, change to digit2 by first setting the digit2 driver onstop here. the segments are still driving a number 5, but are now on digit2now, change the segments to a number 7ok. looks good nowthat brief time the number 5 'shifted' to digit2 will be somewhat visiblehow visible may depend on how efficient the display is, among other things

author: Random Model Maker
author_rank: Regular Contributor
timestamp: October 31, 2017, 11:13:12 pm
content: Thank you very much, it worked wonderfully!Was quite easy if you know how (duh).I had tried something with turning all digits off for 1ms and then turning the concerned one on again, but that did not work.Changing segments in between did not come to my mind.