I decided to try and make the assembler less ugly first by using indirect addressing to access the Period[8] array but it is no faster than my laborious method and this one will only run on an...
Type: Posts; User: FinchPJ; Keyword(s):
I decided to try and make the assembler less ugly first by using indirect addressing to access the Period[8] array but it is no faster than my laborious method and this one will only run on an...
Thanks so much for your helpful thoughts - I will go away and work at your suggestion - I agree interrupts may not be accurate enough - you are quite correct I am monitoring the 8 baby PICs'...
Thanks for your advice - I will think about your "Fun stuff" - actually the actual timings/test results are the opposite of what you understood from my description:
so for a 1000 uS pulse you get as...
OK - the scenario is measuring multiple (8) pulses arising from eight simple 12F675 circuits outputing pulses - I can change that to whatever I want, currently 1mSec pulse every 50 mSec, but the...
I need to make 8 simultaneous (relatively) measurements of pulsewidth on 8 different input pins - is there a PIC that could handle this with timers or interrrupts?
OK - here it is in Assembler - disappointingly not that much faster!
'**** mPULSIN defines ***
Period var word[7]
mPort var PortB
Mask con %00000011 'Mask of port pins to check
i ...
OK - I have written a PicBasic routine to do mPULSIN - a bit slow as you would expect, but works
for i = 0 to 7 : Period[i] = 0 : next
pCount = 65535 '...
Does anyone have any experience of multiple PULSIN measurements - ie simultaneous on more than one pin - obviously would need to sample for a full sample period - 65535 cycles to be sure no pulses...
PBP evaluates expressions progressively - try using parentheses:
IF ((RANGE0 < FAR) AND (RANGE0 > NEAR)) THEN
I am assuming FAR is actually greater than NEAR not vice versa?
Peter
Another error: you define Prati as a byte then use it as a label - remove the byte definition. Also you assign the output value to Isprati which is undefined
Peter
Two thoughts:
1) I have found fuses are set by the loader fuse configuration, so no effect of changing them later
2) OSCCON = 00000010 is not the same as OSCCON = %00000010, rather = %00001010 ie....
It is - and it decodes as typical PicBasic code - a sample of lines follows:
processor 12F683
Radix DEC
#include "P12F683.INC"
__CONFIG 0x3CDC
ERRORLEVEL -302
ORG 0000H
GOTO L00D7H
I am not familiar with PonyProg, are you using the SI-Prog baseboard hardware and the I²CBus eeprom adapter - I note that the adaptor does not have any pullup resistors on SDA and SCL and the...
I suggest you use a data array to send your bytes, and then you need to construct the ControlByte and address as in this example:
Dat VAR byte[16]
i var word
j var...
Actually I was wrong about the Addressing - I hadn't noticed you were using a 24C16 - I normally use larger chips - in fact the 24C16 needs a byte for the address. Unfortunately the addressing you...
Further investigation has revealed why your checksum still worked.... (sorry for the rather brief earlier reply - it was from my mobile phone!). If we use the following code:
I2CAddr Var...
BTW you defined I2CAddr as a byte, but treat it as a word (2048) - should be a word.
Peter
Now that is seriously helpful - Sorry I didnt spot those earlier on my searches - thank you so much for your help Bruce (and Darrel) - you are amazing!
Peter
Since our production circuit board has been professionally produced, there is not room for an extra Xtal and caps to drive TMR1 so I am trying to get the WDT to do the wake from sleep but with only...
I have just had a chance to check this out and it works fine - add:
UCON var byte EXT
to your PBP 2.46 program and it should solve the problem! You can now refer to for example:
...
Thanks for all your help Bruce - this is a followup to report that an external 32 KHz crystal and two 33 pF caps have sorted my sleep problems - for the record this works a dream:
T1CON = ...
I had the same problem - have now bought PBP2.6 upgrade but have not tested yet but I got around this in assembler where UCON is recognised:
T0CON.7 = 0 ' Disable USBservice...
Thanks for your help Bruce - it has clarified my (mis)understanding - looks like an external Xtal for Timer 1 is the way to go.
BTW in case anyone is mislead by:
into thinking Timer0 could be used...
OK - it IS late but I am now starting to understand the Datasheet - I am switching into an Idle state, not a sleep by using
OSCCON.7 = 1 'Set IDLEN - switch to SEC_IDLEif I use
...
Well, I carried on trying and reread the Datasheet - It states
The power-managed Sleep mode in the PIC18F2455/2550/4455/4550 devices is identical to the legacy Sleep mode offered in all other PIC...