Im seriously starting to really dislike Microchip PICs.... Linker Files and the such... then NEAR/FAR omg...
Im planning on using USB MSD and also need a huge buffer for when USB isnt used...
If i power the Device VIA USB CABLE then i want to use the USB Buffer for USB MSD STUFF
if i power the device VIA external POWER then i want to use the USB buffer for something else...
How can i create another variable to overlap on USB MSD buffer space ?
My Site
AtomSoftTech: C18 TIPS & TRICKS v9 PDF
My Name: Jason Lopez
My Store: SHOP
My eBay Store: eBay!
My Forum: Forum
Im seriously starting to really dislike Microchip PICs.... Linker Files and the such... then NEAR/FAR omg...
My Site
AtomSoftTech: C18 TIPS & TRICKS v9 PDF
My Name: Jason Lopez
My Store: SHOP
My eBay Store: eBay!
My Forum: Forum
On PIC32's, I have used malloc() and free() to allocate and free large variables.
Not sure whether it is available or worth it for your PIC, though.
Last edited by Gobbledok; 1st February 2012 at 11:00 PM.
There are 10 types of people in this world: Those who understand binary and those who don't.
If it wasn't for Thomas Edison, we'd be all watching TV by candlelight.
If you mean the 512 byte dataBuffer/FATBuffer. The easiest way to use it would be to create a struture type for your data, create a pointer of that data stucture type and assign the address of the buffer memory you want to use to that pointer. I have not looked at the MSD code but I would guess if you don't use the functions it's internal data buffer memory location should still be free to read or write by other processes.
My comments are my own and don't represent the views of any company.
In GOD we trust, all others we monitor.
ok having enough space isnt the issue i found out... what could cause this problem with SPRINTF ?
Code :while(1) //FOREVER LOOP { getstr_uart(Rxdata,5); //GET 5 CHARACTERS ... WORKS as you can see in image memset(TxStr,0,20); //Clears the buffer (works) sprintf(TxStr, "Hello %s!\n\r\0",Rxdata); //[B] THIS SETS THE ENTIRE BUFFER TO 0xFF [/B] str2uart(TxStr); //Usually works but jumps out and turns on some leds for some reason... }
Last edited by AtomSoft; 2nd February 2012 at 02:35 AM.
My Site
AtomSoftTech: C18 TIPS & TRICKS v9 PDF
My Name: Jason Lopez
My Store: SHOP
My eBay Store: eBay!
My Forum: Forum
Is 0xDDC (the location of TXStr) a valid data memory address on your chip?
My comments are my own and don't represent the views of any company.
In GOD we trust, all others we monitor.
Technically yes... but its clasisfied as USB VARS so im trying to this now:
Code :#pragma udata vars unsigned char TxStr[20]; unsigned char Rxdata[6]={0}; unsigned char Txdata[] = "UART Operational!\n\r\0"; #pragma udata
where vars is GPR1 aka 0x100 to 0x1FF but still i get the same issue... you can see the address changed but all 0xFF still.
![]()
My Site
AtomSoftTech: C18 TIPS & TRICKS v9 PDF
My Name: Jason Lopez
My Store: SHOP
My eBay Store: eBay!
My Forum: Forum
What happens without the memset(); command?... I'm just wondering if the function is some how changing the pointer to a rom pointer. as that would cause this effect..
I'd give my left arm to be ambidextrous
Nigel's tutorials in asm... http://www.winpicprog.co.uk/
Nigel's tutorials.. re-written in C. http://www.electro-tech-online.com/c...torials-c.html
Same exact thing without the memset() command.... The only good thing ive done is setup the Linker so its in a good location of memory heh
Tried it like:
&TxStr and TxStr no luck...
Last edited by AtomSoft; 2nd February 2012 at 02:34 PM.
My Site
AtomSoftTech: C18 TIPS & TRICKS v9 PDF
My Name: Jason Lopez
My Store: SHOP
My eBay Store: eBay!
My Forum: Forum
Just to see if sprintf requires a const rom pointer .... Go into program code and look at code position 0x100 and see if the code is 0xff ---> 0xff;
I'd give my left arm to be ambidextrous
Nigel's tutorials in asm... http://www.winpicprog.co.uk/
Nigel's tutorials.. re-written in C. http://www.electro-tech-online.com/c...torials-c.html
| Tags |
| Similar Threads | ||||
| Thread | Starter | Forum | Replies | Last Post |
| cadsoft eagle, force single layer | glmclell | General Electronics Chat | 2 | 3rd August 2004, 02:57 AM |
| Voltage to dot graph,overlap problem | Screech | General Electronics Chat | 11 | 9th March 2004, 03:10 AM |
| desperate! how to force mplab to erase pic program memory? | huanyong | Microcontrollers | 8 | 9th October 2003, 01:35 AM |
| servo force feedback | DirtyLude | Robotics & Mechatronics | 0 | 27th August 2003, 08:17 PM |
| I need a force sensor | fraughton | Electronic Projects Design/Ideas/Reviews | 1 | 3rd February 2003, 07:38 PM |