Jump to content

2sb18

EstablishedMember
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

0 Neutral

About 2sb18

  • Rank
    Newbrie
  1. Hi Guys, I have a program where I multiply ints by constants, and then in the ISR I multiply things together. I've been getting some strange problems. I was wondering, are the PRODL and PRODH registers context-saved during an ISR, or am I supposed to do that myself. I looked at the assembly code and it looks like just the STATUS, WREG, BSR and FSR are context saved. I know during an ISR you shouldn't be doing calculation-heavy operations like multiplication but in this case it's necessary. I've been working with Sourceboost and BoostC and both surpass my expectations. Thanks for the great program.
  2. Thanks Dave and Pavel, Just wanted to let you guys know I really appreciate the work you're doing with SourceBoost and BoostC. Keep it up! Steve.
  3. Hi, Could someone tell me why I can't do this: #define COS_WAVE 0; if(waveform == COS_WAVE) { wave_value = cos[counter]; } but I can do this: if(waveform == 0) { wave_value = cos[counter]; } I have a feeling it's because I'm using the #define incorrectly. What can I do to get around this? Thanks, Steve.
  4. Hi, I was wondering if arrays can have 256 elements yet, or is it still at 255? It would be nice if it was 256 so you could just use a char to loop through the array. Thanks, Steve.
  5. I've figured out what the problem was. I moved my files at the same time that I downloaded 6.10 so I thought the problem was with the new sourceboost and not with the moving of files. But I was wrong. It seems that pp.exe doesn't like stuff being in lots of directories. When my project was in c:\Documents and Settings\Owner\My Documents\.... on and on, it crapped out. I moved it to c:\PicProgramming\... and it worked. Steve.
  6. Hey, I just downloaded the 6.10 and was all excited to use it but when I wen't to build my project, I got the following error. I don't know what that means. Does anyone else? Thanks, Steve
  7. Hi guys, I'm just curious, does BoostC support the extended instruction set? Thanks, Steve.
  8. In SUS.asm I have: char attenuationD; char attenuationData[numOfLoops][numOfSends]; attenuationData[1][0] = 40; In Attenuators.asm I have: extern char attenuationData; extern char attenuationD; attenuationD = attenuationData[1][0]; When I do this I watch attenuationD and it looks like it's value is 5 instead of what I think it's supposed to be, 40. I know the solution is probably pretty simple, I'm just new to C. Thanks, Steve.
  9. Hi, In my main header file SUS.h I have the following: char currLoop; In SUS.c and Attenuators.c I have the following: #include "SUS.h" I get a duplicate global variable error. How should I define a global variable? Thanks, Steve.
  10. Yes, that worked. As for arrays, I don't have any. Are their internal arrays created by the compiler that could be overrun? Wouldn't this cause the PIC to operate improperly? Steve.
  11. I'm using a PIC16F688. Another thing I noticed is that sometimes I hit "build" and it fails, and then I hit hit "build" again and it is successful. This isn't really a problem, I'm just curious why that happens. Also, I just wanted to thank you and Pavel for creating such a good piece of software. It's nice to know that two people with enough gusto can rival (and in many ways do better) a big company like Microchip (their C18 compiler) in terms of quality and price. Thanks, Steve.
  12. Thanks Dave, I'm pretty sure there wasn't anything wrong with my code either. I even used MPLAB SIM to run through the asm and it worked out as expected. When I make it: void MoveCursorToDestination(char cursorDestination) { //ScreenReturnHome(); while( cursorDestination > cursorPosition ) { cursorPosition++; //ShiftCursorToRight(); } } void ShiftCursorToRight() { SendByteToScreen(shiftToRightByte,0); cursorPosition++; } It doesn't work in the Debug. When I make it void MoveCursorToDestination(char cursorDestination) { //ScreenReturnHome(); while( cursorDestination > cursorPosition ) { ShiftCursorToRight(); } } void ShiftCursorToRight() { SendByteToScreen(shiftToRightByte,0); cursorPosition++; } It works in Debug. Either way, it works correctly in the PIC. Am I going insane?!?
  13. Hi, I just got BoostC acouple days ago. I'm having to relearn C as I haven't used it since university. Things are going well, but I have a simple problem: char cursorPosition; void MoveCursorToDestination(char cursorDestination) { ScreenReturnHome(); while( cursorDestination > cursorPosition ) { ShiftCursorToRight(); } } void ShiftCursorToRight() { SendByteToScreen(shiftToRightByte,0); cursorPosition++; } When I call MoveCursorToDestination(4) and cursorPosition is 0, the while loop conditional computes properly the first time and ShiftCursorToRight() is called. Then cursorPosition is incremented to 1, and the for some crazy reason the while loop conditional is computed to be false even though cursorDestination is 4 and cursorPosition is 1. I'm using the "watch" feature to display the values of the variables. Can somebody explain what's happening? Thanks, Steve.
×
×
  • Create New...