Author Topic: PIC18F4550  (Read 822 times)

0 Members and 1 Guest are viewing this topic.

Offline paulstreatsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,381
  • Helpful? 21
PIC18F4550
« on: July 19, 2010, 04:19:56 PM »
Just a quick heads up for people using the PIC18F4550 (USB enabled MCU).

 Most of the memory banks in the linker script are assigned to the USB stack. I was porting my mapping robot program over to the 18F4550 and it started going haywire, if I modified a value in one of the mapping arrays then it started modifying the value of an INT that was in no way related to it whatsoever.

 Worse still... when using the debug simulator, then even more of the general purpose data memory is used up on the debugging mode.

 So if anybody tries writing programs for this mcu and notice very strange behaviour then this is probably why.

I got around the issue by changing the gpr1 and gpr2 registers to span the USB registers to allow more data memory for the program but unfortunately this removes the USB functionality... (which was the reason for porting the code in the first place :'()


PS. I spent about 8 hours looking for bugs in the code until I realised. I hope this post prevents anybody else wasting so much time.

 

Related Topics

  Subject / Started by Replies Last post
11 Replies
4305 Views
Last post January 15, 2008, 02:26:53 PM
by paulstreats
2 Replies
6139 Views
Last post August 03, 2008, 05:13:47 PM
by paulstreats
0 Replies
738 Views
Last post September 09, 2010, 08:38:16 AM
by LXE
2 Replies
3263 Views
Last post June 14, 2013, 06:12:04 PM
by waltr


Get Your Ad Here