Resource clash PWN and s/w uart on a 328l

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

FFMan wrote:if i play about with the order of the functions [...]
What I have found is that a register is getting trashed by the OpenPWM() call that should be being preserved. Consequently, the behavior will vary depending on how the compiler allocates register usage and in some cases it will be completely benign.

Now that I know what is happening I just need to track down why.
- Don Kinzer
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

dkinzer wrote:What I have found is that a register is getting trashed by the OpenPWM() call that should be being preserved.
I believe that I have found the cause of the problem and have fixed it. The problem potentially affects the AVR mega-based ZX devices that have only one 16-bit timer.

You can download an experimental version of the mega328P ZBasic library using the URL below. In that .zip file, the file libmega328P.a should be copied to the zlib/avr/lib subdirectory of the ZBasic installation directory (renaming the existing file first if desired).

http://www.zbasic.net/download/zlib/4.3 ... ga328P.zip
- Don Kinzer
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

i can confirm that amended library fixes the issue.

is that a permanent fix ?

thanks
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

FFMan wrote:is that a permanent fix ?
Yes, it was a very clean fix - something that should have been spotted long ago.

I'll be posting a new installer with the updated libraries in a few days.
- Don Kinzer
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

trust me to find it

thanks for sorting it, i can put the project back together now

regards

Alex
Post Reply