|
By working closeley with our customers and selecting the right device(s) for a given job, J-Tech can, and does, produce first-class firmware solutions. Some of the 'criteria' typically considered in the choice of microcontroller, DSP or FPGA are:
An illustration of low-level firmware code is shown below. The example depicts design expertise typically employed in our development cycle. LRXRATE ;Generate counter values for bulk transfer mode. btfsc _bulkrateflag ;If the bulk channel flag was set, goto LRXSTARTSTOP ;then we come here. This should ;be the sample-rate setting byte. movf _rxholdreg,w sublw _maxtxrate ;If request out of bounds, reject. btfss _c ;---bit set if result is positive. goto LRXDATAEND movlw HIGH(LRXRATE) ;Setup pclath register for computed movwf _pclath ;goto. bcf _c ;Ensure when we rotate, the lsb rlf _rxholdreg,w ;is clear. andlw _lonibble >> 1 ;Mask off the three lsbs. addwf _pcl,f movlw ((_adcsr * 3) / 1) goto LRXSTORERATE movlw ((_adcsr * 3) / 2) goto LRXSTORERATE movlw ((_adcsr * 3) / 5) goto LRXSTORERATE movlw ((_adcsr * 3) / D'10') LRXSTORERATE movwf _bulkrate bsf _bulkrateflag return A block of code from an embedded control application. The code is written for a Microchip PIC processor. Comments are detailed enough that it may be interpreted without further reading. Documentation, as always, is critical to the success, portability and reusability of firmware developed for any project. The above code shows a configuration function for an embedded control application. In the case shown, when this code executes, a decision as to whether valid data is present is made, followed by verification of whether or not the data is within bounds of what is expected. If all is well, the result is manipulated into a program branch offset. Once this has been done, the value offset is added to the program counter, and the branch is thus 'taken'. When the destination of the branch is reached, the desired value for the original calling function is loaded into the processor's accumulator, and a second branch is unconditionally taken to an exit point for the block. At the exit point, the freshly obtained results are stored, and the program returns to the main thread of execution. The reader may notice that a little higher-level math appears to be taking place in the operand of some of the assembly language instructions. This arithmetic is computed at assembly time. The code that is actually programmed into the device will have a fixed number in place of the computation. The result of the above methodology is that the code is highly portable, and can easily be moved between processors in the Microchip family. A simple re-compile is all that is required to accomodate changes in processor clock-speed as well. J-Tech Engineering is available to discuss any special coding requirements for your products. We find partnering closely with our customers produces the most effective designs possible. Our customers' successes are viewed as our successes. Please see the company information page for contact information.
|