Jump to content

kersing

EstablishedMember
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About kersing

  • Rank
    Newbrie
  1. Hi Dave, Tried working around the issue by removing the memory reference but as you suspected this does not solve things. I was looking into using the 16f1455 (16 series with USB) for a project, I've already created a TDF and include file for it, but as USB uses the linear memory that won't work. Any chance the linker will be fixed in the near future? Regards, Jac
  2. Hi Dave, Could I work around the linker issue by modifying the TDF and removing the low (0020h) memory reference to force the linker to use the linear memory or will this not work? Regards, Jac
  3. Target device PIC16F1824. I'm trying to use the linear data memory for an array (small for now, but might grow) but I'm running into issues. Trivial example code: #include <system.h> void main() { int a; int b[10]@0x2000; int c; a = 1; while (1) { b[0] = a; c = b[0]; porta = a; a++; b[0]++; } } Looking at the pertinent bits of generated map file: Register usage ============== Address Bit Lengh Bit Mask Unique Name Name ------- --------- -------- ----------- ---- 00000020:00000010 main_1_a a 00000022:00000010 main_1_c c 00002000:000000A0 main_1_b b Looking at figure 3-10 of the data sheet, linear memory starting at 0x2000 overlaps the bank 0 addresses 0x20 to 0x6f. So it seems the array uses the same memory used by variables a and c. The TDF file specifies a RegisterGP length 50 at 0020h,2000h so it seems the compiler/linker should know about the overlap? Am I missing a compiler/linker switch or some (source) code magic? Best regards, Jac
  4. Ben, I modified the usb_joy_mouse sample found in the picpack distribution and no surprise, it did not work. However, 5 hours debugging later... Take a look at the function usb_handle_reset() in pic_usb.c. You'll find two hard coded references for the bd0out.addr and bd0in.addr. (0x0500 and 0x0508 respectively) Once I changed those to USB_EP0_OUT_ADDR and USB_EP0_IN_ADDR the code started working. Best regards, Jac
  5. Ben, Do you have the .casm file(s) of a working example and of a failing one? Looking at the differences might shed some light on this. Best regards, Jac
×
×
  • Create New...