Thanks, everyone, for the suggestions.
After a different diagnostic strategy, I discovered I had made a really dumb mistake.
I accidentally swapped (from a working scrap of code a few days ago...
Type: Posts; User: RussMartin; Keyword(s):
Thanks, everyone, for the suggestions.
After a different diagnostic strategy, I discovered I had made a really dumb mistake.
I accidentally swapped (from a working scrap of code a few days ago...
Thanks, Bruce.
I've used ADC with other devices (12F683; 16F88; 16F1827) and always gotten by with the RC clock.
Can I use DEFINE ADC_CLOCK 1? Or if I use ADCON1=%00010000, do I simply omit...
Peter, thanks for chiming in. I added the parentheses. Still nothing, but it's a good point nevertheless.
Yes, FAR is greater than NEAR. In fact, the way I have the pots configured, NEAR can...
Thanks, Al.
It's the same delay used by jellis00, but I think he was running 18F devices and I don't know at what speed. (Or if that would make a difference.)
Yes; per the SRF02...
I'm noodling (finally) with an SRF02 ultrasonic rangefinder, communicating via I2C with a 16F688.
I've used a similar program for an IR rangefinder, but I can't get this to work.
Blinky tests: ...
I'm going to be working with the SRF02. I'd be interested in knowing what you developed. I assume it was I2C and not serial?
Mine is Rev. 0, October 2006.
Okay, fixed it myself.
I added a PAUSE 10 as shown.
But I surely do not know why the fix worked!
. . .
READ 254,PFLAG ' Get state of memory protection
This, on a 12F683 and PBP 2.47, works fine:
@ INT_ENABLE TMR1_INT ; Enable interrupt for timebase
CYCLE=0 : FLASH=16 : FLASH2=9 ' Initial values for "idle"...
They are indeed temperamental. The timing information in the data sheets may be off by as much as 25%, and this is different from one device model to the next.
I've been working with one for the...
This works like a dream!
Thanks, Darrel!
Thanks, Charles.
The PBP manual says of DEFINE WRITE_INT 1
Disable/enable global interrupts in Write, which is why it sounded like a toggle to me.
Looking at the 16F88 manual at 3.6.1,...
For WRITECODE, my PBP manual (2.60) states (p. 176):
If interrupts are used in a program, they must be turned off (masked, not DISABLED) before executing a WRITECODE, and turned back on (if...
Once again, Melanie, you've saved my bacon!
It was Vref+ and Vref-. This is what I needed to do:
ADCON1 = %11101000
Bit 2 "0" selects Vss (internal) for Vref-
Bits 1-0 "0" selects Vdd...
Alain, I didn't post code, schematic, or board because all three work just fine with a 16F88. Now, except for controlling the output pins (which Darrel solved in...
PIC16F1827 at 32MHz and PBP.
My AN channels, specifically AN5 and AN6, are each connected to the wiper of a different pot giving a voltage range of 0-5VDC.
Based on what I see on the...
Then:
The reason the old PORTB.1 worked is that little scootch of additional time between OHI=0 and OLO=1 caused by the GOTO?
Were there Olympic Gold for PBP help, you'd get it!
I'll be working with TMR1 and IOC interrupts during the next few/several days (going back to the "reverse Simon says" project) and will let you know how those fare. NRN.
Sonofagun! It works. Thanks!
What did we just do?
And why was PORTB.1 working but not the others?
Here it is:
@ __config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF & _BOREN_OFF & _FCMEN_OFF
@ __config _CONFIG2, _STVREN_OFF & _LVP_OFF
OLO VAR PORTB.5
OLM VAR PORTB.4
OMD ...
I didn't include anything else because (a) everything ran fine on the '88 and (b) one of the five identically-processed channels is working just fine.
All five channels are handled like this...
I've also tried to make sure the CCP/ECCP modules were off by adding:
CCP1CON=%00000000
CCP2CON=%00000000
CCP3CON=%00000000
CCP4CON=%00000000
No change from previous result.
I discovered the capacitive sensing module and have added:
CPSCON0.7=0 to turn it off.
The effect was that the one working channel continues to work.
The pot on AN6 also now works.
But...
Okay, I'm overlooking something. This program worked (albeit slowly) on a 16F88.
5 analog pins sample and (after manipulation) produce a high or low to a pin. Here's the correspondence:
AN0...
If my "blinky" is any indication, it works fine for INT_INT, which is the only one I'm using at the moment. I also tested it (INT_INT) in the full program, and it is working, both on the output and...