18LF2520 as PWM TIMER or LOOP? (Oshonsoft BASIC)

Thread Starter

camerart

Joined Feb 25, 2013
2,761
Hi,
Here's a program where I've joined a TIMER program which works and a SERIAL IN program that also works, but together they don't.

If the line with ################### is in the program, then the TIMER works, and if it's commented out then the SERIAL IN works. (Copy and paste '$1100,1200,1300,1400,1500,1600,?' into the HSERIN in the SIM)

Any ideas please?
Camerart
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
2,761
hi C,
You have not said which Timer.? I guess Oshonsoft is using the timer for PWM timing, so try a different Timer.
E
Hi E,
I used a program that you wrote years ago, using TMR1. I've been looking at it, and it could be that TMR0 should have been used, but I'm not sure. I'll try it.

EDIT: I've just noticed that in the LOOP part of the program, it uses PIR which is part of a TIMER set up, so must be clashing with the TIMER (TMR1) section. I'll have to start again and try TMR0.

C.
 

Attachments

Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
2,761
hi C,
You have not said which Timer.? I guess Oshonsoft is using the timer for PWM timing, so try a different Timer.
E
Hi E,
I'm trying a test for PWM. A timer (Now TMR0) sets the 20MS LOOP required for the SERVOS, and within this LOOP I will add 6x ON/OFFs using RB0-5.

In the MAIN LOOP, is your modified NMEA sentence stripper, that I have changed for the incoming serial DATA for the PWM outputs.

I hope I've been clear?
Here is the TMR0 test program. It may be working ok?
C.
 

Attachments

Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
2,761
Hi,
Here's the program with the TMR0 this time, which appears to be working now.
Next I've got to figure the TMR0 LOOP time, I've got to set it to 20MS.

EDIT: A few errors corrected.

C.
 

Attachments

Last edited:
Top