- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, m very new to this and i guess this sounds rather basic, but i really need help..
in my project i have just a pwm block that is used to activate the LED. It seems the pwm is executing just one cycle and then there is no change. LED remains off initially, goes on and then remains in the same state. the code:
#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
#include "PWM8.h"
int val;
void GenerateOneThirdDutyCycle(void)
{
/* set period to eight clocks */
PWM8_WritePeriod(23);
/* set pulse width to generate a 33% duty cycle */
PWM8_WritePulseWidth(7);
/* ensure interrupt is disabled */
PWM8_DisableInt();
/* start the PWM8! */
PWM8_Start();
}
void main(void)
{
void GenerateOneThirdDutyCycle(void);
M8C_EnableGInt ; // Uncomment this line to enable Global Interrupts
// Insert your main routine code here.
/* function prototype */
/* Divide by eight function */
for(;;)
{
GenerateOneThirdDutyCycle();
}
}
I tried the same with global interrupts disabled as well.. got the same result.. please help..
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Suggest the following -
1) Move "void GenerateOneThirdDutyCycle(void);" before your code for this
function. I am sure it compiled correctly as you did not state it errored, but
normally a f() proto needs to occur first when scanned by compiler.
2) Your code shows an infinite loop calling GenerateOneThirdDutyCycle(),
so PWM always being set to same parameters, and you are turning off
interrupts, so what is the point of having an interrupt ?
3) I do not see any pragma for a C interrupt, so conclude you are doinjg a ASM
based interrupt. Therefore you would have modified the PWM8INT.asm file....?
4) What did you want an interruot to do ?
5) Next ime post entire project if you can, easier to see what you are doing,
settings, etc..
6) This post belongs in the PSOC 1 forum. "File", "Create Workspace Bundle", and
post.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you.. will do.. but i didnt understand the point about pragma in c? wat does that mean?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which you can't understand? When you would do expain the point, you coild get a answer. ----
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey PSoCkers! What was happen? Cypress got a progress!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My reference to pragma for C interrupts was PSOC 1 by mistake, GNU,
as you probably know, quite different. Ignore my past comment, my
mistake.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
coild-->could