Thanks for all the reply posts.
Ingvar was right on the money with "Try making the pin INPUT right after each soundgenerating command."
I'd originally had TRISA = %11100, PORTA.1 an output but had changed it to an input before my original post. That had made the first startup beep go. Having read that due to DC bias the port should be an output and idled low I'd added a line after each SOUND command - PORTA.1 = 0 but that hadn't worked. Changing it to TRISA = %11110 made it work well enough. When the LEDs reach an end at a different time there's a regular beep. If the same time there's a slightly louder beep. If I make it beep twice or more per LED bank at either end and they reach it at a slightly different time then they fight it out with sometimes a squalk or two.
I have a question also. In the manual it stated that the SOUND command automatically makes a pin an output. I wasn't sure if it makes it a pin set as input an output for the duration of the sound then returns the pin to an input or not. From the look of it it doesn't. Does this apply to all the other commands that automatically change a pins state or are there exceptions?
I haven't tried the PortA.1-capacitor-piezo-PortA.1(on other pic) setup yet and sougata has put me off a little. If it's safe for the PICs I'll give it a go.
Many thanks,
Rubicon.
Bookmarks