Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About chris

  • Rank
  1. Hi gurday, I dont think it is possible to assign an address to a rom pointer, if you read the manual it says that a rom pointer is 'internally limited to 8 bits'. When you use a rom pointer the compiler generates a lot of code for you to access program memory, it is not the same as accessing ram, you have to do a bit more work to read and write program memory. You need to read the Microchip manual for the part you are using and you will see it explains how to access program memory. What Dave is suggesting is that you write your own routines for accessing program memory rather than use compiler
  2. Hi HexRex, you really need to post more code, but one thing you can try is setting 'trisc.6 = 0', the tx pin needs to be output for 18f252 and input for 18f2520.
  3. Hi, I stand corrected, I suppose the easy thing to do is check the disassembly listing, so for pic18 parts STATUS, BSR, FSR0H, FSR0L, PRODH, PRODL are saved and there is a compiler switch to turn this behaviour off and you can save whatever.
  4. Hi again, microchip provided source code for the 16f765 that would enumerate as a hid class mouse. You should be able to download from their website, the example code provided would move the mouse cursor in a circular motion on your screen, so it should be fairly easy for you to adapt.
  5. Hi Yodar, unfortunately a uart will not work with the ps2 protocol, it is very similar to i2c though, so you may be able to use existing i2c code and modify it. If there is no special reason to use the ps2 protocol you may consider usb with a pic 16f765 ( i think) and use microchips mouce driver code from their website.
  6. Hi, I doubt that prodh and prodl would be saved, I imagine just the bare minimun of registers were saved in the interest of speed. You may well find that in the a future version of BoostC that code that duplicates functions is automatically generated, especially as parts have increasingly larger program memory, but as this is not currently the case you have to work within the confines of the compiler and write your code to suit, I have never had a headache from using BoostC, in fact quite the opposite, your getting very good value for money, any way, all the money you save from buying a BoostC
  7. A couple of quick points - turn the watch dog timer off and reset RCIF flag after it is set on a receive. If that does not help post back.
  8. Hi lank23, you will need to post your source code before anyone will be able to help you, it is impossible to understand what you are trying to do with the limited information posted.
  9. The manual states that a block erase should be performed before writing program memory, at least now you should be on the right track to progress. It is well worth spending a bit of time looking at the assembly listing as it can be a very good aid to debugging. With the small instruction set of the pic it is not that hard to pick up, maybe try writing a few short programs to get the feel of it, and I think it gives a better understanding of the pic.
  10. From looking at the file, this is the generated code from the c code posted above. As noted before, the 4 words of program memory that were written to will not get overwritten by the final loop, they would need to be erased first, but the block that was erased is not getting overwritten at all which is very strange. Is the rom_error.jpeg generated from this code or your other code ????? It looks as though the sequence is in the correct order in the assembly listing, are you sure that the program memory that is left unprogrammed is set to 0x3FFF each time you program.
  11. In the workspace window (the one with all the files listed) you should see a file in the 'Output' folder with a .lst extension, that will show you the assembly code generated as well as the .asm file as well. I prefer to use MPLAB as the IDE as you get a better disassembly listing.
  12. Hi again, sorry for that, I assumed that was the case. You can edit the .mcp file in your project directory - [TOOL_SETTINGS] TS{49571987-4DB6-404E-B859-D38AC1DF8220}=-O1;-p|"$(TARGETBASE)";-t;-ld ;;/ld D:\Sourceboost\BoostC\lib libc.pic18.lib TS{44A9C2D2-3C5E-4C16-B2D8-E4E7F95F1073}=-O1;-W1;-t;; TS{49571987-4DB6-404E-B859-D38AC1DF8220}000=-O1;-p|"$(TARGETBASE)";-t;-ld TS{44A9C2D2-3C5E-4C16-B2D8-E4E7F95F1073}000=-W1;-t;; above is the section that contains the compiler and linker switches, have not tried this so make a copy if you do. If it works then post. Also,
  13. Hi, what does the disassembly listing look like, you should be able the follow the sequence of events from that, or post it here or the complete routine in c.
  14. Hi, if you are using MPLAB you can set optimisation level in the project settings, Project->Build options->Project then select BoostC compiler tag. In Sourceboost I am not sure, try Settings->Options
  15. Hello DavidT, I think the problem is that to write program memory it has to erased first, you are only erasing a small block then writing 4 words which cannot be overwritten, hope that makes sense.
  • Create New...