Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ATMega1284P Config TIMER1

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

Bascom Member



Joined: 23 Jan 2007
Posts: 165
Location: Vermont

usa.gif
PostPosted: Sun May 10, 2020 9:40 pm    Post subject: ATMega1284P Config TIMER1 Reply with quote

I have some older code that I copied this line from:

Config Timer1 = Timer , Prescale = 1024 , Compare A No_output = Set , Clear Timer = 1

I scratched my head trying to figure out why PD4 would not work as an output. Eventually I started
with some simple test code and it was ok. As I backed into my full software putting the test
code in after each line I found that the above line was causing my problem.

Looking at the the HELP I found a new format for the Config Timer1 command:

Config Timer1 = Timer , Prescale = 1024 , Compare_a = Disconnect , Clear Timer = 1

Changing the line fixed the problem.

While THAT problem is solved, are there other commands that have been changed where the
legacy code is not supported? I realize that is a big question so it may be more rhetorical than
anything else.



(BASCOM-AVR version : 2.0.8.2 )
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 673

poland.gif
PostPosted: Mon May 11, 2020 6:59 am    Post subject: Reply with quote

If you dont know the proper syntax then you can always type CTRL+SPACE. For example "Config = " then CTRL+SP and so on. After comma hit CTRL+SP again and you get hints like "Compare_a" ... this is easy and I show this more then once with the pictures on the forum so not this time Very Happy

Look at the my 8 post in this topic -> https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=14519
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4974
Location: Holland

blank.gif
PostPosted: Mon May 11, 2020 8:53 am    Post subject: Reply with quote

actually you had : Compare A No_output which means that the the OCx pin will NOT be set to output mode. And that was not working correct : in your old code with the syntax you used the port should not be set to output mode.

The spaces are still allowed by the compiler but the preferred syntax is to use under scores.
When you have old code, it is best to check the history.txt to see if there were changes.

_________________
Mark
Back to top
View user's profile Visit poster's website
rkumetz

Bascom Member



Joined: 23 Jan 2007
Posts: 165
Location: Vermont

usa.gif
PostPosted: Mon May 11, 2020 1:18 pm    Post subject: Reply with quote

albertsm wrote:
actually you had : Compare A No_output which means that the the OCx pin will NOT be set to output mode. And that was not working correct : in your old code with the syntax you used the port should not be set to output mode.

The spaces are still allowed by the compiler but the preferred syntax is to use under scores.
When you have old code, it is best to check the history.txt to see if there were changes.


I suppose that I neglected to mention that I was using the pin as a general purpose output pin (not as part of the timer system)
in both the old code and the new. The old code worked properly but the new would not allow me to change it using a Portd.4 = 0.
It simply remained high. I did configure the pin as an output.


In the future I will refer to the CTL+SHIFT. That is very helpful!
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