BUSHBANDIT
New Member
We are a non profit enginnering department in a teaching hospitail and have used the PIXAXE (and pic/ AVR) chips for rapid development of customised H/W applications to assit in patient care and providing modification aids and adaptions for the disabled -ie wheel chair controller to interface to communication aids or PC for example.
we have an application that has been running well on the 40 X1 @16mhz.
recentely we have shifted to the 40x2 and caried out the required syntax changes to the existing code. we wiish to eventually expand the functionality of the exixting unit and the responsiveness.
However since the mirigration the interrupts have been giving us grief, we are trying to achieve an accurated 1 sec timer, 10minute timer (as all pins are used including 4 i2c devices ) without the use of a RTC.
ISSUE !
i coded have set that appears not to work
setfreq em32
settimer t1s_16
(as tls_32 word bite dosent exist, and the required count exceeds the word restriction)
The interrupt subroutine that stands at the moment is below.
interrupt:
inc w27 (this being the 10 minute tracking routine as well)
if w27 >599 then
w27 = w27-600
endif
set_timmer:
toflag = 0
timmer = 65534
setintflags %100000000, %100000000
with in the main loop there is routines of
writing to a serial LCD
reading one wire temperature devices
reading 4X 12c linear technology LTC4151
reading digital i/o from switches
commputational routines with data logging to a UALFAT_TF
communicating serially to a smart LIFEPO4 battery
and a serial PC connfiguration port
these are all timed based driven events -
ISSUE 2
we also want a more interrrupt driven based code routine would the below codding be reasonable?
interrupt:
select case flags
case toflag
inc w27
if w27 >599 then
w27 = w27-600
endif
goto set_timmer
case hserflag
proscess serial and reset interrupt
case....and so forth
end select
Thanking you for your time and assistance
Greg
we have an application that has been running well on the 40 X1 @16mhz.
recentely we have shifted to the 40x2 and caried out the required syntax changes to the existing code. we wiish to eventually expand the functionality of the exixting unit and the responsiveness.
However since the mirigration the interrupts have been giving us grief, we are trying to achieve an accurated 1 sec timer, 10minute timer (as all pins are used including 4 i2c devices ) without the use of a RTC.
ISSUE !
i coded have set that appears not to work
setfreq em32
settimer t1s_16
(as tls_32 word bite dosent exist, and the required count exceeds the word restriction)
The interrupt subroutine that stands at the moment is below.
interrupt:
inc w27 (this being the 10 minute tracking routine as well)
if w27 >599 then
w27 = w27-600
endif
set_timmer:
toflag = 0
timmer = 65534
setintflags %100000000, %100000000
with in the main loop there is routines of
writing to a serial LCD
reading one wire temperature devices
reading 4X 12c linear technology LTC4151
reading digital i/o from switches
commputational routines with data logging to a UALFAT_TF
communicating serially to a smart LIFEPO4 battery
and a serial PC connfiguration port
these are all timed based driven events -
ISSUE 2
we also want a more interrrupt driven based code routine would the below codding be reasonable?
interrupt:
select case flags
case toflag
inc w27
if w27 >599 then
w27 = w27-600
endif
goto set_timmer
case hserflag
proscess serial and reset interrupt
case....and so forth
end select
Thanking you for your time and assistance
Greg