Page 1 of 1

Flowcode 11 PWM

Posted: Fri Dec 12, 2025 8:52 am
by pantelispv5
Hi, I have a fairly simple project and I need to use the PWM on channel 0 (channel 1 in Flowcode) in a ATtiny25 chip. Although the simulation seems fine the real chip do not seem to respond. I have checked the enable, prescaler, dutycycle, pin B0, etc. I use an ELNEC smartprog2 programmer and I first compile the project to HEX and then I download to chip. The clock is from internal RC osc. 8 MHz. Any idea?

Re: Flowcode 11 PWM

Posted: Fri Dec 12, 2025 9:21 am
by Steve-Matrix
My first step in debugging this is to make sure a "1 second flasher" program can be downloaded successfully and works as expected. This rules out so many issues with timing and the toolchain in general.

Once you have done that and proved that there is not a timing or reprogramming issue, then you can focus on it being an issue with the PWM.

Hopefully that helps. If you are certain there is an issue with the PWM, then maybe post a simple project hat shows the issue and someone here may be able to see what the problem is.

Re: Flowcode 11 PWM

Posted: Fri Dec 12, 2025 12:36 pm
by pantelispv5
Steve-Matrix wrote:
Fri Dec 12, 2025 9:21 am
My first step in debugging this is to make sure a "1 second flasher" program can be downloaded successfully and works as expected. This rules out so many issues with timing and the toolchain in general.

Once you have done that and proved that there is not a timing or reprogramming issue, then you can focus on it being an issue with the PWM.

Hopefully that helps. If you are certain there is an issue with the PWM, then maybe post a simple project hat shows the issue and someone here may be able to see what the problem is.
The problem is solved by setting the clock source to 8 MHz Ext crystal oscillator. Then compile to HEX and download to chip using the smartprog2 which of course is set to internal RC osc. 8 MHz. Any advice on why that is happening?

Re: Flowcode 11 PWM

Posted: Fri Dec 12, 2025 1:15 pm
by Steve-Matrix
Glad the problem is solved. Perhaps the programmer you are using is setting the config for the device. I am not familiar with that programmer.

Re: Flowcode 11 PWM

Posted: Mon Dec 15, 2025 2:35 pm
by BenR
As a sanity check I've just checked the settings in the Flowcode chip definition file and it all matches up with the datasheet. So I can't see why it's appearing backwards for you. As Steve suggests it could be the programmer being odd?

Re: Flowcode 11 PWM

Posted: Mon Dec 15, 2025 5:50 pm
by pantelispv5
BenR wrote:
Mon Dec 15, 2025 2:35 pm
As a sanity check I've just checked the settings in the Flowcode chip definition file and it all matches up with the datasheet. So I can't see why it's appearing backwards for you. As Steve suggests it could be the programmer being odd?
I am not sure if it is a real programmer's weird definition in their chip listings. But if you checked it is not a problem in Flowcode's specific chip configuration table then all good. I will check really when I have the time.
I also have a programming issue to solve with the ADC. I think it is better to ask in another post