Hey Dave,
Did my code work on your PicKit1 board?
I did find a couple 684s in the bottom of a drawer. Once the pins were straightned out they worked in the test board. But I had to program them with a PicKit2 The PicKit1 kept giving an error?
Hey Dave,
Did my code work on your PicKit1 board?
I did find a couple 684s in the bottom of a drawer. Once the pins were straightned out they worked in the test board. But I had to program them with a PicKit2 The PicKit1 kept giving an error?
Dave
Always wear safety glasses while programming.
Hi mackrackit,
Sorry for the late reply, Sunday is 'family' day(say no more!).
I had some errors on Compiling the first program, so had a hunt around looking for Configuration_Fuse info (found this page:http://www.picbasic.co.uk/forum/showthread.php?t=543)Did my code work on your PicKit1 board?
I did find a couple 684s in the bottom of a drawer. Once the pins were straightned out they worked in the test board. But I had to program them with a PicKit2 The PicKit1 kept giving an error?
So changed your code to this for the 684:
The program compiled and ran a treat. What happens is that when a Voltage of 2.5V appears on PORTA.0 (pin13 on the 684) the LED's on D0-D3 light in turn on after the other. If the Voltage drops below 2.5V they turn off. How does that sound.Code:DEFINE OSC 4 CMCON0 - from CMON @DEVICE_INTRC_OSC_NOCLKOUT @DEVICE_WDT_ON @DEVICE_MCLRE_OFF @DEVICE_CP_OFF
Dave
Last edited by LEDave; - 1st August 2010 at 20:25.
Yup, family come first!!!
I use MPASM in place of PM for the assembler. If you are using Micro Code Studio you can change that in compiler options. PM is OK though, until you get to using 18F parts.
Yes, on the first code the analog break point is at the halfway point.
When you get a chance to run the second code you will see how it is split even more. Lots of things can be done with this, like the code shows, one input can effectively become many, sort of.
Now take all this back to the LDR thing and you can have light, dark, and options for something in between.
Dave
Always wear safety glasses while programming.
For the second program I made the same Config changes, the program worked a treat two:
When the pot is turned LED D3 lights at approx:1.25V (pin13), D2 lights at 2.5V (D3 goes out). At 3.75V D1 lights (D2 goes out). And at 4.95V D0 lights up and D1 goes out.
I must say mackrackit, this is very clever stuff.
I'm thinking for the project, the LDR set against a pre-defined ADC voltage trigger level would be spot on to send the data at a set light night time light level.
I'm still doing loads of reading / studying, I've got a few things I'm not sure of so may have to get back to you on those, bear with me.
Dave
Last edited by LEDave; - 1st August 2010 at 20:48.
Ah, I see you posted while I was still composing.....
Yes this would work a dream.Now take all this back to the LDR thing and you can have light, dark, and options for something in between.
I think this project will contain nearly everything we've covered so far in one programRF.ADC,SEROUT2,EEPROM data storage, Serial Communicator - LCD......!
Loving it: Dave
No problem. If only all students worked as hard as you have...I'm still doing loads of reading / studying, I've got a few things I'm not sure of so may have to get back to you on those, bear with me.
And all since February... COOL!!!!I think this project will contain nearly everything we've covered so far in one program RF.ADC,SEROUT2,EEPROM data storage, Serial Communicator - LCD......!
Dave
Always wear safety glasses while programming.
Like I said way back when mackrackit, I'm not naturally bright but I am a trier....No problem. If only all students worked as hard as you have...
Yes it's amazing really. As we all know I couldn't blink an LED when I first came here...! As much to do with the Teacher as the pupil me thinks / knows...!And all since February... COOL!!!!
Dave
Hey Dave..
What happens if the order of CASE IS is switched around? Why?
Code:SELECT CASE CHAN0 CASE IS > 254 TRISA = %11001111 PORTA = %00010000 CASE IS > 192 TRISA = %11001111 PORTA = %00100000 CASE IS > 128 TRISA = %11101011 PORTA = %00010000 CASE IS > 64 TRISA = %11101011 PORTA = %00000100 CASE ELSE PORTA = %00000000 END SELECT
Dave
Always wear safety glasses while programming.
Bookmarks