Jump to content

TTom

EstablishedMember
  • Content Count

    24
  • Joined

  • Last visited

Community Reputation

0 Neutral

About TTom

  • Rank
    Regular
  1. Jorge.... The example you have given me is awesome. I have a question about the line: *sPtr = '\0'; // Place the null terminator of the string I am assuming that when the program gets done with the for loop, it will have incremented the sPtr to one memory location beyond the Destination string, Is that correct ?
  2. Jorge... Thanks for the advise... I think I will try the specific code in "C" on my PC before trying it on the PIC. I've never used the 8051, however I know it is a very popular chip. If my memory serves me correctly it was used in keyboards, maybe still is. I actually started with the 8080 back in 1980.
  3. Jorge... Oh yes, I read the explanation, and reread the explanation, and I understood it completely. Since I was going to use 66 values,( I start out with just 6 just to get it to compile) I wanted to start the array at the beginning of a user block of memory. If you will check out the 16F886 you will find that the starting address 0xA0 would give me 80 bytes of continuous memory. However at this point I see another problem. The "int" is 16 bits wide, so I am going to have to use the "char" instead of the integer since it is only 8 bits wide. Anyway Jorge, I can't thank you enough for your detailed explanations. I really appreciate the time you have taken to help me get this thing going. I'm sure there will be other problems I will run into. richardc... I also want to thank you for your help. I have worked with about 6 different microprocessors, and CPU chips since 1987. But like I said in the beginning of my post, all of my programming has been done in assembler. In fact the first computer I built using the 68701 chip I programmed in machine language. So my knowledge of "C" is NILL. I want to learn "C" so I can develop my projects quicker. In Conclusion, Without you guys out there helping us who are completely ignorant in a particular field, I don't know what we would do. BoostC is fantastic after you get your program to compile, but if you can't get it to compile it is about useless without your help. Programming can be very rewarding, but it can also be the most aggravating process when you can't get it to compile.
  4. So this is basically what I want to do: int x; int y; int arr[] = {65,22,39,48,57,66} // Create an array x = arr[y]; // where y is some value from 0 to 5 ..... Get some value out of the array
  5. richardc... The reason I put the address location is because that's the way the BoostC document showed on page 50. I realize now that I don't need to do that but I was just trying to do something to make it work. The line....int arr[6]@0xA0 = {65,22,39,48,57,66}; will compile so I figured it worked. But my problem now is to try to get the values out of the array and put them in a variable. Say: x = arr[0]; But this code doesn't compile. I would also like to write an expression that would contain a variable that would point to a value in the array. example : x = Some expression using the variable y to point to a specific value, then increment y and get the next value. Do you know how to do this ?
  6. So.. If I create an array with : int arr[6]@0xA0 = {65,22,39,48,57,66}; int x; I want to write an expression that takes the value of the first number and put that value in a variable, say x... Such as: x = arr[0]; But this does not compile. Then I want to be able to put a variable into the expression instead of using a fixed value so I can sequence through the array.
  7. Jorge... Thanks so much. I will work with this and see what I can do.
  8. How do I point to the first value in the array and get it's value into a variable ?
  9. OK ... Now I have learned how to declare and fill an arrey with: int arr[6]@0xA0 = {65,22,39,48,57,66};
  10. Jorge... I was wondering where you were.. I am new to "C" , so I will make a lot of mistakes... What should the code look like ? I just tried anything I thought might work. How do I access the values in the array ? I am assuming I need to use pointers, but I don't know how. I have been looking on the Internet, but the programs are very involved... I need to start out simple and then go to complex.
  11. Amazing... I forgot to put the semicolon at the end of the lines of code. int arr[6]@0xA0 #define arr[1,2,3,4,5,6] When semicolon added it compiles
  12. Maybe I should just use the RETLW command and go to assembler. From what I can determine Sourceboost BoostC has about the worst error declarations I have seen in any IDE I have worked with. i.e "general error" - that is vague and useless.
  13. According to the Reference manual on page 50 I don't see why my code fails. I have started with : int arr[6]@0xA0 #define arr[1,2,3,4,5,6] If I can make an array of 6, I should be able to make an array of 66
  14. Actually I need to get more information on Arrays, not strings. I need to know how to: Fill and array with values, and access that array.
  15. I need to find some sample programs using strings. Can anyone help me ? I need to send 66 packets of information out PORTA that are 2 bits wide.
×