Matthew Barr (@matthewbarr)
Hi Zainiii, you mentioned that the pump terminal software works with a USB-to-RS-232 conversion cable plus null modem adapter, driven from a USB port on your laptop.My...
Ditto Eric! Yes indeed, this happens pretty frequently and I can imagine several reasons for it.Based on the original post any number of things could be wrong outside...
Hello Zainiii, I agree with tcfkat and was going to make similar suggestions. In particular, checking the RS232 serial lines with a scope is a very good idea. As...
I have a Picoscope 3205D MSO (100 MHz) and a Rigol DS1054Z (50 MHz) at home. I've used them for UART, SPI, I2C, SMBus and CAN with good results.Pico Technology makes...
Understood, and if it's not in the stop disable state then writes should work. It looks like the I2C settings register (0xDA) should tell you what state it is in,...
From the IQS620A data sheet revision 3.00, section 7.4, page 34:Please note:1. Stop-bit disable and enable must be performed at the beginning and end of a
communication...
Hi Max, my understanding is that the compiler handles memory layout behind the scenes for the two representations in the union, and there is no language defined,...
I emphatically agree with MichaelKellet's great answer. Definitely have a look at CANbus activity using a scope with CANbus serial decode capability. You can learn...
A cast tells the compiler that the storage (raw byte data) associated with an object of one type should instead be interpreted as a different type.When one of the...
You may have trouble casting if there is a memory size or a memory alignment boundary mismatch between variable and struct.In general you should be looking for...
I agree with your comment on CANopen. MODBUS is straightforward but plug-and-play is problematic because the single Master must initiate all communications. You...
Indeed, it depends entirely on what the compiler knows about the variable and how it handles it. As the comment indicates in your code example, it would be unsafe...
Great answer Mark. Variables that can be written by non-interrupt code and by an interrupt service routine are another common situation where a volatile declaration...
Yes, when I used the Lantronix XPort they distributed their SDK in the form of a VMware linux image. Seems kind of cumbersome for everyday lighweight project use,...
Great observation, I couldn't agree more. Ideally someone would be able to commit just project source files and build recipe (project files, Makefiles, whatever)...
Yes, much better, I've developed those test hooks and related phy/link tests for IEEE 802.3ae SerDes designs. Remote (vs. local) loopback capabilities are often...
Hi Matthew,I have manufacturing test experience with one relevant product which consisted of a number of small board assemblies, one with a 1000BASE-T interface.The...
Without knowing the real time requirements of your application it is hard to be very emphatic about a recommended approach. You are absolutely correct to worry...
Hi Max, I think your map decodings look good, if you missed anything then so did I. In your discussion it might be worth noting that you can also decode 0's and...
Yes! Toggle switches are painful to debounce, you put a scope on the thing and you can't believe what you're seeing...
Hi Max, interesting question, "circuits/funtions" covers a lot of territory!There are canned debounce ICs available from various sources. Easy and reliable, this...
Oh, from your original post I didn't realize you were this far along, the slow reveal!What you have done makes sense, and you might want to spend some time debugging...
You have a lot of choices, and it seems like standard wireless protocols (BLE, Zigbee) and LoRa wireless transceivers would work but are probably overkill. If you...
Yes!You might eliminate the local variable target and explicitly cast:rampAccumulator = ((uint32_t) value) << 8;
For these kinds of variables I will typically define them in a C source file outside of the functions that use them, and create one or more init functions as...
> Do you think that it would be feasible to write the Fighter's software in assembly language?Yes> If so, do you think the software bugs' quantity would be...
I agree with Michael, it isn't obvious why you return struct2 as opposed to just letting fn() fill in the return information you care about in struct1.If you really...
The best way to come up to speed on a complex SoC device like this is to start with an example project. Familiarize yourself with the device architecture and board,...
Yes, agree with all that! C++ brings its own baggage to the party, but class instantiation, encapsulation and consistency checks are worth the cost. With C you...
OK, I just took a closer look at this. I've never tried to make this work with one buffer. I've typically used two buffers, a receive buffer where an RX interrupt...
Yes, absolutely correct, you have to pay attention to that. Using string lengths to trigger the comparison makes sense whether you use strncmp() or strcmp() because...
Yes! I couldn't agree more emphatically with this. Spend as little time in the ISRs as possible, keep them dead simple. Perform all of your string or message handling...
As others have pointed out, strcmp() requires NUL terminated strings.You also have the option of using strncmp() if you know your string length. A NUL termination...
Based on the devices you connect to your microcontroller, you either need a serial interface or you don't.You typically use SPI or I2C to communicate (configure,...
Hi mik3ca,It sounds like you want to be able to encode 256^3 possible values with only 253^3 encodings? This is like looking for a way to encode 4 values in...
Yes! COBS is a great approach, it allows you to use a single 0x00 between packets to delimit packet boundaries. COBS guarantees 0x00 doesn't appear in the encoded...
With 4k words program memory and particularly with 192 precious bytes of RAM, you are going to need a very lean event-driven real time framework in order to have...
Ignoring the cable for the moment, the 470 ohm resistor determines how fast your signal will transition from low to high. The open collector driver sinks current...
That's interesting, different from how I've learned to look at integral error.I've been taught that integral error is intended to prevent the system from running...
Yes, or simply re-initialize (zero) the integral error when exiting blocked mode and let it start re-accumulating. Likewise with derivative error, re-initialize...
It looks like your bumpless transfer assignment is supposed to prevent this from happening:m_U1 = *m_Trk; // u(k-1) <- last actually used control value (for...
Good luck with this. An organization that doesn't have the discipline to develop and embrace their own design best practices may be unwilling to embrace a starting...
Various design standards (coding, safety, regulatory compliance, etc.) more commonly apply to an industry. If you're working in a particular space you have to use...
Yes! I would write == TRUE instead of != FALSE (or just omit the != FALSE) but same logic in any case. I believe you can better optimize your C1 and C2 computations:C1...
1. IDLE/ACTIVE is used to keep track of whether or not you have a conversion running. You may be able to discern this from ADC status registers, in which case you...
I think you're on the right track, but with a super-loop you generally want to keep everything non-blocking, particularly when you care about real time behavior....
I'm sorry, I don't have any familiarity with that TI DSP platform. It sounds like there is a problem driving the top side switches based on the current Hall state...
The tools seem to be trying to tell you that somewhere you have an output pin definition or configuration problem. If this is a configurable device the so-called...
With high speed differential line drivers, typically a vast majority of the current and power dissipation is associated with driver stage. At high data rates the...
That's a long distance, which will probably limit your data rate. The fact that you are point to point (vs. multi drop) should help.I'm puzzled about your UART...
Interesting approach to anti-windup, I've not seen this before and it makes great sense. If I understand correctly, the idea is to prevent integral state accumulation...
Short answer is yes!I'm guessing someone wants you to get this working, then extend to closed loop operation. The commutation block in your diagram should perform...
I think there's a problem in your understanding here. Duty cycle is not computed or derived from anything in this open loop operation case, it is an input to the...
If they've got code examples for a basic BLDC controller I'd start there.The very first thing you should do is get a dead simple demo project to build, load and...
Yes, very nice! Note that your back-EMF phase sequence top-to-bottom is A-C-B rather than A-B-C. Again, the important thing is to apply power from the bridge consistently...
Hey, that looks reasonable! I'd re-order your table this way, this should be the electrical cycle commutation state sequence from top top bottom:Switching StateH1H2H3A+B-010A+C-110B+C-100B+A-101C+A-001C+B-011You...
Yes on the electrical cycles, 8 poles (4 pole pairs) should give you 4 electrical cycles per mechanical revolution. You'll see one complete cycle on each Hall sensor...
With motor phases attached to a resistor "Y" and Hall sensors powered, I manually cranked a motor in both directions and captured back-EMF and Hall sensor waveforms...
Here's a brief article talking about 60 vs. 120 Hall spacing, you should be able to tell from the posedge relationships relative to a full cycle:Parker 60 120...
First a quick sanity check, Hall sensors are typically powered from 5V and the outputs are open drain, requiring pullup resistors to the 5V supply. (There is often...
I think the voltage for this exercise is not particularly important, the important thing is use a reasonable current level! There's very little phase resistance,...
OK, I have to call shenanigans on Figure 10 and Tables 1 and 2 in the Microsemi document! If you're trying to learn from this atypical if not just plain incorrect...
Here are a couple plots showing the relationships between line-to-neutral back-EMF, Hall sensor inputs and the related bridge driver states for a particular motor....
I fundamentally agree with mr_bandit's answer. You really have 3 options:1. Obtain the Hall sensor wrt. phase timing information for your motor.2. Reverse engineer...
I just want to add that today's commercial motor control solutions are far more sophisticated and elegant than a simple trapezoidal control solution.It is common...
The minimum pieces you need to develop are a core control loop or loops, bridge (gate driver) commutation state decode from PWM and Hall state, an average current...
It sounds like you're controlling the 6 inputs to the bride gate drivers directly from low voltage outputs on your micro.What sort of PWM scheme are you considering?...
Yes indeed! I think most would agree that firmware for a fixed-function sensor with some type of serial interface and no human UI qualifies as deeply embedded,...
This seems more of a marketing than technical distinction, based mainly on complexity. Any attempt to define "deeply" based on clear objective criteria (memory...
Hi Moga, if you are thinking that you will easily be able to flash the BLE device from the debug probe through the MSP432, I suspect you are going to be disappointed.For...
I was going to answer, but now I don't have to! I agree with all the comments and suggestions in Mr_Bandit's answer. In particular, read the data sheet, there is...
I think something like that would work. The issue I see looking at your "skip" examples in an earlier post is that you've got many special cases to consider due...
One thought on header numbers, I think there is a way to eliminate your "skip" case so you only have to detect a non-sequential header number boundary. Lets assume...
Interesting. Not knowing any better, I had assumed that you would be looking for the wrap-around boundary associated with the most recently written header so you...
Hi Steven,I wrote essentially the same flash logger as you describe not that long ago. The total number of circular buffer slots was not large, so a linear search...
They're using the sign to indicate the direction of current flow, negative when sourcing (Voh) and positive when sinking (Vol).For a digital push/pull output,...
That 25 mA number is probably an absolute maximum rating, you don't want to operate there. Look at the Voh and Vol specs, they'll give you a min high and max low...
If you have a GPIO that you are using as a digital input, you would set the the data output register to a 1 and configure the output control as open drain. Don't...
It sounds like your protocol really only needs one address, the client address. You would need sender and recipient if you wanted to support client-to-client communications,...
:-)Even in the 8051 world you can find inexpensive devices with 64k code space and more, and with 2k-8k XRAM. As an added bonus you can even program them in C,...
The short answer is that it depends on the processor architecture, there is no one-size-fits-all answer to your question. One processor may save minimal architectural...
Here's the argument for having more time to process RX data with a simple ISR and buffer.With an RX buffer of N character times and a simple ISR, you basically have N...
Wow. Kudos for nutting this out in assembler and getting it to the point of functional even with some performance issues. It isn't obvious why you're coding in assembler...
It sounds like you may have a problem reliably framing receive packets, particularly in the presence of errors where you have to flush data so you have an empty...
You've accounted for the 2 + 2 ms to send + receive 11 bytes at 56 kbps, and have added 6 ms for processing time.That's would be 6 ms processing time total, 3 ms...
Normally one would write code like this in C, you'd do the math with floats and convert back to integer. The overhead is not bad, particularly if you avoid division,...
The Wikipedia PID control page has a nice pseudo-code algorithm near the bottom, PID with Kd=0 collapses to PI. Their computation is slightly rearranged, they factor...
The dt term is usually the discrete PI controller update period in seconds. For a fixed Ki it will decrease the contribution of the integral term at each update...
Turning down Kp is certainly the main knob to control overshoot at startup, Kp is essentially your loop gain.If you request a target RPM of 3000 starting from 0...
As BVRamesh has pointed out, you have to determine an appropriate low RPM limit for your application and factor this into your control loop update interval. You...
I think you have this right, exact terminology may vary depending on what you're reading or who you're talking to. What is called clock latency in the first diagram...
In general it should not be necessary to send an all 0's pad byte in front of a defined data transfer for a particular SPI slave device. If it is necessary, the...
You might take a look at the Wikipedia page on bit error rate, a good starting point for many topics.I don't know anything about your transmission environment, so...
RF is not my bag, but if you search for "rp sma male to sma female adapter" or "rp sma male to sma female cable" I think you'll find what you're looking for. For...
I have no experience with this TI platform which makes this little more than a guess, but it appears that the load on the AUDIO signal changes when you plug in...
Assuming your LM1117 is good to 800 mA, try setting the lab supply current limit to 800 mA and see how things go. If you then see a hang with the lab supply, perhaps...
First a disclaimer, I am not familiar with Leon 3 so this comment may be off mark.You wrote: "I'm sure that the bits in the register are changed but when I do the...
I am at risk of telling you more than I absolutely know, but I think you are getting transmit errors with CANH/L shorted that you would not see with a normally...
Does "disturbance" mean that you simply don't respond to a request, or do you actively interfere with bus activity?If the disturbance is the temporary absence of...
Wow, you have my sympathy here, assignments where someone else has done the conceptual work and you get to finish it can be difficult. It really depends on how clean...
As already mentioned, this is a very general question with no background context, so providing any specific suggestions is guesswork.Are you dealing with a point-to-point...
There are Silicon Labs 8-bit MCUs that have 4 8-bit registers, SN0 SN1 SN2 and SN3, that define a unique 32-bit device serial number. See the data sheet for the...
Yes, good point. Offline in Table 4 really means Offline or Offline Bias. The transceiver won't go into Offline Bias without the right activity on CANH/L and being configured...
CAN bus is a bus just as the name implies, transceiver CANH and CANL pins are all directly connected in parallel with a termination at each end of the bus. The...
Use this form to contact matthewbarr
Before you can contact a member of the *Related Sites:
- You must be logged in (register here)
- You must confirm you email address