Jump to content
 

Leaderboard


Popular Content

Showing content with the highest reputation since 12/23/2018 in Blog Comments

  1. 1 point
    I just want to say thank you. I learned a lot from this post.
  2. 1 point
    It goes into flash, the USB device has code to reprogram the device flash.
  3. 1 point
  4. 1 point
    I had fixed the problem. MPLAB X v5.4 is with UART 1 output.
  5. 1 point
    Thanks for pointing out the mistake, I have updated the post to show 2.0 LSB which is the correct Offset error for this device
  6. 1 point
    Thank you so much for this helpful document. In the offset error section; you first say the offset error is 2.5 LSB but then you mention it as 0.5 LSB typical and 2.0 LBS at max. This made me confused a little bit
  7. 1 point
    Hello, the information in this post is by far one of the best I've seen for ADCs! Thank you for passing this information along to others! I have a few questions I hope you could answer.. 1. How did you get the equation to calculate the fractional number of bits [Log(# LSb error)/Log(2)]? 2. For a high impedance input, does the voltage offset due to leakage current contribute to the LSb error? Thanks!
  8. 1 point
    Hey, I just noticed that there are some over-clock options. Here is the result when clocked at 960MHz. I could not get it to run at 1GHz. They did warn that cooling was required.
  9. 1 point
    More Data! I just got a Teensy 4 and it is pretty fast. Compiling it in "fastest" and 600Mhz provides the following results. Strangely compiling it in "faster" provides the slightly better results. (6ns) This is pretty fast but I was expecting a bit more performance since it is 6x faster than the Teensy 3.2 tested before. There is undoubtedly a good reason for this performance, and I expect pin toggling to be limited by wait states in writing to the GPIO peripherals. In any case this is still a fast result.
  10. 1 point
    I completely agree with you! I try to avoid comments, because they tend to de-synchronize with the actual code very easily. #pragma config PWRTE = ON // Power-up Timer Enable bit->Power up timer disabled What does that mean? Is it a bugfix? Is it a bug? I find this so often in mature projects. Someone edited bit masks for a register, but forgot to update the comments. Even the Hungarian notation as an extended version of commenting de-synchronizes eventually, because you tend to ignore the prefixes after a while. uint32_t u16counter; So my personal approach is to find identifiers and names to formulate a readable code, which says everything what is actually happening on that specific line of code. There is no need to write functions with many lines of code to make the compiling more efficient or save stack space, modern compilers will optimize that out again. Encapsulating a partial solution not only brings structure to your code, it makes the function actually readable. And with readable I mean to read it out loud in front of an audience (e.g. for a code review). Comments should give the reader a general overview of the problem and an abstract strategy what has to be done in a function. If the purpose is obvious and easily derivable from the identifiers, why create a second meta layer which needs extra maintenance and creates a dependency? This in turn often means that an over-commented code doesn't have a good structure or the author doesn't understand the problem well enough to abstract it. Although sometimes the project dictates code metrics, like a code to comment ratio that has to be satisfied. I see a lot of projects with Doxygen comments in it, but the actual content of that documentation is rather unhelpful.
  11. 1 point
    Wandering to here, just want to ask some questions : 1. "The type of initialization of a union using the second member of the union was not possible before C99" why? 2. typedef signed int t; typedef int plain; struct tag { unsigned t:4; "one named t that contains values" All I see is a unname member. 3. Why on earth can't I use navigation keys and Enter here???
  12. 1 point
    Problem #14: I2C bus repeaters. A lot of them use miniscule voltage shifts to determine which end is driving the bus so it can drive the signal the right way. If you get them to work reliably, go out and buy some lottery tickets before it's too late.
  13. 1 point
    I have to add here that the single thing which trips most people up on RTCOUNTER is the timer period. The timer MUST be free-running, which mean that you can NOT use MCC to set a timer period by using a reload or PR value, the timer HAS to be set to maximum period and the only thing you can modify is the prescaler for the timer to adjust the period. I know this is limiting, but it allows us to have a pure monotonic upwards counting number which we can concatenate with our sw variable to construct the timer. Remember that we want as few interrupts as possible, so running the timer for MAX period is exactly what we want to do here! This library does not have an event when the timer gets an interrupt or overflow (that is what the TIMEOUT driver does if you want that, but there is quite a price for this). When you call the check function it will simply compare the current timer register with the absolute time variable for the next timer to expire, it is a quick compare, so pretty cheap to do this.
  14. 1 point
    Or if you really want to do your head in, check out Whitespace The only active characters are space, tab, and LF. Everything else is treated as a comment.
  15. 1 point
    This brings back memories. As I developed as a programmer, the role of Mel (and his suitability as a role model) has also shifted. Of course we all strive to be Mel when we start out. The idea that we have such in-depth knowledge of our system that we can create the tightest possible code and take advantage of the most esoteric of "features" seems like the epitome of super programmers. Of course as I matured, I learned that this knowledge was incredibly powerful and certainly the ability to use it was an asset but like the old saw, "with great power comes great responsibility". Today, I think the best analogy would be "absolute power corrupts absolutely". I would love to manage a software team with the knowledge and experience of Mel, but I would hate to manage Mel, because in the end, he would cost me a huge amount in future maintenance costs as only another Mel + lots of time could possibly support his work and no program ever survives contact with the users so the inevitable new feature would be a disaster. That aside, be sure to read the detailed explanations. They are as fascinating as the original story. https://jamesseibel.com/the-story-of-mel/ https://medium.freecodecamp.org/macho-programmers-drum-memory-and-a-forensic-analysis-of-1960s-machine-code-6c5da6a40244
 


  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • Create New...