Posted: Sun May 10, 2020 9:40 pm Post subject: ATMega1284P Config TIMER1
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:
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.
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
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
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!
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