Trying to run this simple program, neither sleep not Interrupt working correctly, I am using Proteus 7.6 Professional to simulate it. It keeps blinking LED at PortC.0
;Chip Settings
#chip 90s8535,8
;Interrupt Handlers
On Interrupt ExtInt0 Call second_blinky
Main:
set PortC.0 on
wait 1 s
set PortC.0 off
wait 1 s
asm sleep
Goto main
Sub second_blinky
set PortC.1 on
wait 1 s
set PortC.1 off
wait 1 s
End Sub
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
If you choose ExtInt0 for interrupt , you must first define PortD.2 as an input port :
Dir PortD.2 in .
So , when an event occurs on PortD.2 , an interrupt is generated
GC
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello GC,
Thanks for your reply, tried it and it didn't work, also tried asm sleep without interrupt no luck, I believe 90S8535 is not fully supported by GCB compiler, am I correct?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
At the begining GCBasic was realized to work with PICs , but ATMEL's µC are now supported . I often use Atmega's and it works very well.
AT90S8535 has a register named MCUCR . If you want to be in SLEEPmode , bit6 ( SE=Sleep Enable) of MCUCR must be set (1) and bits 5 and 4 (SM1 SM0) determine what sleep mode you want .
Try to do set MCUCR.6 on , but left MCUCR 5-4 =0 ( iddle mode)
I hope that instruction 'll help you
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
;Chip Settings
#chip 90s8535,8
;Interrupt Handlers
On Interrupt ExtInt0 Call second_blinky
Dir PortD.2 in
Main:
set PortC.0 on
wait 1 s
set PortC.0 off
wait 1 s
Set MCUCR.6 on
Set MCUCR.5 off
Set MCUCR.4 off
Goto main
Sub second_blinky
set PortC.1 on
wait 1 s
set PortC.1 off
wait 1 s
End Sub
I think something real bad going on inside my AVR : (
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello guys,
Trying to run this simple program, neither sleep not Interrupt working correctly, I am using Proteus 7.6 Professional to simulate it. It keeps blinking LED at PortC.0
Hi,
If you choose ExtInt0 for interrupt , you must first define PortD.2 as an input port :
Dir PortD.2 in .
So , when an event occurs on PortD.2 , an interrupt is generated
GC
Hello GC,
Thanks for your reply, tried it and it didn't work, also tried asm sleep without interrupt no luck, I believe 90S8535 is not fully supported by GCB compiler, am I correct?
Hi,
At the begining GCBasic was realized to work with PICs , but ATMEL's µC are now supported . I often use Atmega's and it works very well.
AT90S8535 has a register named MCUCR . If you want to be in SLEEPmode , bit6 ( SE=Sleep Enable) of MCUCR must be set (1) and bits 5 and 4 (SM1 SM0) determine what sleep mode you want .
Try to do set MCUCR.6 on , but left MCUCR 5-4 =0 ( iddle mode)
I hope that instruction 'll help you
Regards
Hey GC,
Tried this but no luck
I think something real bad going on inside my AVR : (