Hi All,
I want to monitor the presence (or lack of) the Serial IN data when a pic is being programmed in my test jig.
I plan to use an 08M2 to monitor what the SER IN pin on the "MAIN" picaxe chip is doing and then have the 08M2 flash a LED to indicate the main device is currently being programmed.
It's more of a visual indicator to remind me not to pull the chip out of the ZIF socket, or turn off the power etc etc.
In the past (long ago) i used to use 74123 or 4528 monostables to detect serial com port data to trigger the monostable to flash a LED, (a type of pulse stretching arrangement) which simply acted as a "data present" indicator.
Now i'm trying to replicate the same thing with a picaxe as the 08m2 is smaller than the older chips and needs no R's or C's etc. ;-)
Looking at my VERY simple code below, would this actually work? or do i need to re-arrange the way i monitor the input pin?
I know i shouldn't use pauses, so i think i need to gosub to a procedure that's probably a "for..next" counter to act as the delay for the LED
( The delay time isn't too critical, as long as it's long enough to flash a LED to be easily seen ).
I'm hoping there's a fast & reliable way to do this without missing too many captures of the incoming data pulses, hence me setting the FREQ to it's highest speed?
I want to monitor the presence (or lack of) the Serial IN data when a pic is being programmed in my test jig.
I plan to use an 08M2 to monitor what the SER IN pin on the "MAIN" picaxe chip is doing and then have the 08M2 flash a LED to indicate the main device is currently being programmed.
It's more of a visual indicator to remind me not to pull the chip out of the ZIF socket, or turn off the power etc etc.
In the past (long ago) i used to use 74123 or 4528 monostables to detect serial com port data to trigger the monostable to flash a LED, (a type of pulse stretching arrangement) which simply acted as a "data present" indicator.
Now i'm trying to replicate the same thing with a picaxe as the 08m2 is smaller than the older chips and needs no R's or C's etc. ;-)
Looking at my VERY simple code below, would this actually work? or do i need to re-arrange the way i monitor the input pin?
I know i shouldn't use pauses, so i think i need to gosub to a procedure that's probably a "for..next" counter to act as the delay for the LED
( The delay time isn't too critical, as long as it's long enough to flash a LED to be easily seen ).
I'm hoping there's a fast & reliable way to do this without missing too many captures of the incoming data pulses, hence me setting the FREQ to it's highest speed?
Code:
#Picaxe 08M2
; set FREQ to highest speed?
; obviously ports/bits configured as INs and OUTs as needed.
Do
IF pinC.1 <> 0 THEN 'If pin is NOT 0, then there must be activity (data/voltage present)
High PinC.2 'Turn a LED ON, on pinC.2
pause 100 'Keep LED ON at least 100mSecs so it's visible.
Else 'otherwise.....
Low PinC.2 'Turn a LED OFF, on pinC.2
Pause 100 'Keep LED OFF at least 100mSecs so it's visible.
End if
Loop 'Keep monitoring for activity on PinA.0 and repeat.