Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About trossin

  • Rank
    Super Enthusiast

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1,263 profile views
  1. Just got burned again on an 18F2620: If I use: rom const char table[]= { ....}; it chews up RAM If I use: rom const char *table = {....}; it does not chew up RAM Using Version 7.22. It is bad enough that I have to break my tables up into tiny 256 byte pieces but until I found this secret, I was ready to go to the dark side (Microchip compiler).
  2. I posted few new projects here (try Chrome if the pictures don't show up) : https://www.sites.google.com/site/tedrossin/home/electronics/pic There are a couple videos of a Lynx Motion AL5D robot arm being driven by a single PIC which controls the servos and walks the spline by doing some math on the fly. The PC just sends the spline parameters and a step rate to get from the current position to the next position. The PIC has a little software FIFO so that the PC is a few positions (key frames) ahead. The PC and PIC handshake for FIFO space to allow playing long sequences. The
  3. Most PIC processors do not have hardware divide logic so division is done in software. It is up to the compiler to decide to implement exception handling or not. Since code space is usually a premium, I would expect that BoostC does nothing but give you a bad answer. For most tiny embedded processors, you will have to check your inputs and handle divide by zero yourself so that you can handle it the way that is best for your application.
  4. Click the Help menu on the SourceBoost IDE then select Plugin Description for details. I also have some examples I wrote here: https://www.sites.google.com/site/tedrossin/. Go to Electronics then PIC. The plugin examples are at the end of the list in the contents section(current #22).
  5. p += p->size; is the complaint.<br /><br />You might try helping the compiler out by doing some type casting.<br /><br />Also, I think SourceBoostC comes with a malloc library that you could use.
  6. My free website has been down for a good amount of time so I moved it here: https://www.sites.google.com/site/tedrossin/ I added a few new PIC projects (Wii Nunchuck interface using an 18F1330, TV speaker auto on/off and a stepper motor controller). I also have a servo control project I'm working on which uses spline interpolation of key frame values. I'm still working on the keyframe editor but it seems good enough for now. Here is a little video of it controlling a Lynxmotion robot arm: https://youtu.be/-VRBuqs75ZM?list=UUUQfBC8Ejgx7KjH8ehWmz1Q I'll post the schematic and
  7. SourceBoost runs fine on Windows 8 and Windows 8.1 and makes super code. MPLABX also runs fine on Windows 8.1 and the C compiler is free, supports floating point natively and variable args for printf. The catch is that it only is free for 18F processors and the code produced is not as small and fast as SourceBoost (for a large sum of money it will produce better code). The free Microchip compiler does not support the same function with different parameters like SB does nor does it have the lovely plugins and ability to write custom plugins for simulation. It is possible with some ifd
  8. Why do the variables have to be together? The following code pieces can shift a 40 bit variable left or right by one bit and shift in the input Input. The 40 bit variable in Verilog speak is {High[31:0],Low[7:0]}. unsigned long High; unsigned char Low,Carry; unsigned char Input; // Shift Left Carry = (Low & 0x80) ? 1 : 0; High = (High<<1) | Carry; Low = (Low<<1) | Input; // Shift Right Carry = (High & 1) ? 0x80 : 0; High = (High>>1) | (Input ? 0x80000000 : 0); Low = (Low>>1) | Carry;
  9. The backslashes are continuation markers. #defines have to be on a single line. To avoid ugly definitions, C compilers allow the backslash to continue the current line on the previous line. #define ICKY you_are(\ int making_me_very_happy); Is the same as: #define ICKY you_are(int making_me_very_happy);
  10. Bug description: In the code below, the "ratio = (x==0) ? 0xffff : BigY/BigX;" returns the result of division the previous time this function was called when fixed_x is set to zero (which makes x 0). I attached a simple project which demonstrates the failure. I am able to work around this bug with an extra if statement "if(fixed_x==0) ratio = 0xffff;". Also, I still get the failure if I swap x for fixed_x in the original case. The code produced fails in the simulator as well as on Silicon (18F2620). It also fails with large and small memory models. In the simple example, the main funct
  11. Is it possible to get sprint with variable arguments or support variable arguments in general like the following? void HeaderPrintf(char *Format, ...) { va_list Marker; char Buffer[50]; va_start(Marker,Format); /* Initialize variable arguments. */ vsprintf(Buffer,Format,Marker); va_end(Marker); /* Reset variable arguments. */ }
  12. Below is assembly code that I use in my boot loader for 18F parts. The full project can be found here: http://www.tedrossin.net46.net/Electronics/Pic/Pic.html Scroll down and click on Serial Port PIC Boot Programmer. I would think you could convert this to C code without much work but the problem is determining what are valid blocks to write. I hope this helps. ; ************************************************************************ ; ** CmdEraseFlashRow: Get High address then low address and erase the ** ; ** row of 64 bytes. Bits 6:0 of the address
  13. OK. This one is a bit more intense than my CheapLA version because it uses a couple Xilinx CPLDs and external RAM but the PIC code shows examples of how to use the synchronous SPI interface to talk to the CPLDs and how to change the RS-232 baud rate on the fly when using faster serial cables. Code to control the timer output (to produce a 100Hz to 2.5 MHz clock) is also included. The project files and schematic can be found here: http://www.tedrossin.net46.net/Electronics/Xilinx/Xilinx.html#LogicAnalyzer2 P.S. I also updated the cheap logic analyzer to work with 3.3V logic by turni
  14. I think you are not being nice to the compiler as it has no idea the dimensions of your array. It thinks you just passed a 1D array when you in fact passed a 2D array. Maybe try: void Init (unsigned char myMATRIX[][16]) { to let it know that it is a 2D array where the smallest index is 16. This way the compiler can calculate the offsets properly. If this does not work, maybe skip passing a pointer to MATRIX and just use the global variable inside your routine.
  • Create New...