You have lost me.
Where is the file being saved? Are you meaning save the data to eeprom?
This page has several samples.
http://www.melabs.com/resources/samples.htm
You have lost me.
Where is the file being saved? Are you meaning save the data to eeprom?
This page has several samples.
http://www.melabs.com/resources/samples.htm
Dave
Always wear safety glasses while programming.
sorry im quite bad at explaining, but ill try my best. ill check that site out as well thanks
basically its being saved in the thing called SRAM, if im correct. which is similar to normal ram but its for special functions. Basically its just implemented as static ram. with an address of F69H for CAP1BUFH, which is the place where "capture 1 register highbyte", the place where the measurement (period in my case) has been stored temporarily, till it is overwritten by the next measurement.
ok its easier than i thought... u can just right the file address in your calculation.... e.g. (F69H)/5
am i right... or wrong again? sorry picbasicpro should be here today for me to learn from trial and error... looking at example codes and old manuals on the internet only goes so far
From Micros web site
Calling it SRAM is a little misleading.Static RAM or SRAM
Static Random Access Memory. Program memory you can Read/Write on the target board that does not need refreshing frequently.
In your case I think you have the idea. You are talking about program variables. Variables to be used inside the program. Not permanent storage.
You have for the 18Fs four variable sizes to pick from
bit, byte, word, long
near the begining of your code you will have something like
Then you can use F69H as in your example.Code:F69H VAR BYTE
The value will be erased at power down.
Last edited by mackrackit; - 19th August 2009 at 11:09. Reason: spelling
Dave
Always wear safety glasses while programming.
ahhh thank you, thats cleared many things up for me. my picbasic pro just arrived so ill be testing all my attempted codings now!
cheers mack
ok well these are the bare bones of my code so far... i havnt actually created the algorithm yet so i havnt actually got a proper dutycycle to put in yet. and things like config settings etc i still have yet to choose. just hope its going in the right direction
'obviously unfinished and dutycycle would not be a fixed 50%'''''''''''''''''''''''''''''''''''Assembley to collect period on cap1 cap2 and cap3''''''
asm
cap1m0 = 0101
cap1ren = 1
cap2m0 = 0101
cap2ren = 1
cap3m0 = 0101
cap3ren = 1
endasm
'''''''''''''''''''''''''''values put in var for us in calculation''''''''''''''''''
F69H VAR BYTE 'Value of period at CAP1 ready for calculation
F67H VAR BYTE 'Value of period at CAP2 ready for calculation
F65H VAR BYTE 'Value of period at CAP3 ready for calculation
''''''''''''''''''''''''''''''''''''Algorithm for finding average''''''''''''''''''''''''
'yet to write it
'''''''''''''''''''''''''''''''''''pwm output'''''''''''''''''''''''''''''''''''''''''''' '''
HPWM 1, 127, 20000
whoops just realised the pwm output wasnt quite anything...
hopefully that should workDutyCycle var byte 'byte being the one that is answer of algorithm when thats created
CCP1CON=0 'output of pwm pin
TRISC= $00000000
HPWM 1,DutyCycle,20000
end
Bookmarks