How did I miss that ! (embarrassed smile goes here !)
I'll re-compile tonight after work and see what happens
How did I miss that ! (embarrassed smile goes here !)
I'll re-compile tonight after work and see what happens
Well must be something with the configuration of port A.
The above works ! as doesCode:DecButton var PORTD.0 ' Press to Decrement Button SetButton var PORTD.1 'Press to Set/memorise Button IncButton var PORTD.2 ' Press to Increment Button
Thanks to all those who posted... at least I've proved my hardware is ok, just need to learn how to set up these devices correctly !Code:DecButton var PORTE.0 ' Press to Decrement Button SetButton var PORTE.1 'Press to Set/memorise Button IncButton var PORTE.2 ' Press to Increment Button
Uhmmm.. tried that and then changed the code to
but that still left the 12/24 hr set mode over-writing each other again !Code:DecButton var PORTA.0 ' Press to Decrement Button SetButton var PORTA.1 'Press to Set/memorise Button IncButton var PORTA.2 ' Press to Increment Button
Malc-C, since it doesn't appear you are using any analog channels in your application I recommend you use DT's "AllDigital.inc" routine as an INCLUDE in your program. It works great and takes care of all the register settings you are trying to figure out so that you don't have a conflict of your digital processing with ports that are set for analog input.
Many thanks for the suggestion. At the moment I'm just verifying that the hardware works, and will (hopefully) be combining this code with some existing code for other functions, one of which has 4 pots on AN1, AN2, AN3 and AN4, so I'm really looking at setting up PORTA for a 50/50 split of analogue / digital when I come to migrating this all to a new PIC (18F4580) when my samples arrive![]()
I'm looking at using the code to set a photo period, ie at a set time, say 11:00 pm lights go off, then at 06:00 am lights come on.
Is it a simple case of : (not actual code, more logic)
Code:set off time set on time I2CRead SDApin,SCLpin,$D0,$00,[RTCSec,RTCMin,RTCHour,RTCWDay,RTCDay,RTCMonth,RTCYear,RTCCtrl] If RTCHour=>off time or <=on time then lights off Else lights on
Bookmarks