Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

config timer1 and why pin's state high

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 115

poland.gif
PostPosted: Sun May 18, 2025 12:28 pm    Post subject: config timer1 and why pin's state high Reply with quote

Hi,

I don't understand why on pin PB.1 still I get signal (checked with osciloscope), shouldn't be pin PB.1 low instead of high so far?
here my code:
[code]
'ARDUINO PRO MINI 3.3V
'Bootloader zaktualizowany do optiboot (jak UNO) w wersji dla uC zasilanych 3.3V
$regfile = "m328pdef.dat"
$crystal = 8000000
$baud = 9600
$hwstack = 100
$swstack = 100
$framesize = 100

'Config Portb.1 = Output : Led1 Alias PORTb.1 : reset Led1 'OC1A
Config Timer1 = Timer, Compare_A = disconnect, Compare_B = clear, Prescale = 256, clear_timer=1
Config int0 = Low Level
compare1a=15000

On compare1a gen1
enable compare1a
Enable Interrupts
gen1:
Return
[/code]
Regards,
Martin
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1130

poland.gif
PostPosted: Sun May 18, 2025 1:33 pm    Post subject: Reply with quote

First of all maybe you need a "Do : Loop : End" Without it program will reach end of flash and start from the begining.
_________________
Check B-Flash -my MCS bootloader app for Android (updated)
Back to top
View user's profile Visit poster's website
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 115

poland.gif
PostPosted: Sun May 18, 2025 2:15 pm    Post subject: Reply with quote

Hi,
Of course you're absolutely right, I even did it before (and it looked that it didn't help, and I wondered what the hell...).
What a ridiculous mistake I made! I updated and still changed the code, but with the persistence of a maniac I uploaded another .hex file, haha!

Regards,
Martin
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum