Pumpkin, Inc.

Pumpkin User Forums

Simple Salvo Problem

If you can't make Salvo do what you want it to do, post it here.

Simple Salvo Problem

Postby ryanjpcush » Tue Jun 15, 2004 3:37 am

Hi I am an Msc student and I have started using Salvo Lite (before I buy main version)for my dissertation. I have gone through all the tutorials which come with it and understand them fully.

My problem is that whenever I try to use the code that is used for tutorial 3 to light some leds (I'm using a FLASH-LAB 77 board) they wont light. In debug mode on MPLAB v6.4 the Port pins are being set correctly but when I download the code to the PIC18f452 using ICD2 the leds wont come on - is there something simple I'm not doing??

Thanks in advance ryanjpcush@hotmail.com

Here is the code
/************************************************************
Copyright (C) 1995-2002 Pumpkin, Inc. and its
Licensor(s). Freely distributable.

$Source: C:\RCS\d\salvo\tut\tu3\main.c,v $
$Author: aek $
$Revision: 3.7 $
$Date: 2003-06-13 17:05:13-07 $

Source for tutorial programs.

************************************************************/

#include "main.h"
#include "salvo.h"
#include <pic18.h>

_OSLabel(TaskCount1)
_OSLabel(TaskShow1)

unsigned int counter;

void TaskCount( void )
{
for (; ; ) {

PORTC=0xff;

OS_Yield(TaskCount1);
}
}

void TaskShow( void )
{
InitPORT();

for (; ; ) {

PORTB=0xff;

OS_Yield(TaskShow1);
}
}

void main( void )
{
Init();

OSInit();

PORTB=0x00;
TRISB=0x00;

PORTC=0x00;
TRISC=0x00;


OSCreateTask(TaskCount, OSTCBP(1), 5);
OSCreateTask(TaskShow, OSTCBP(2), 5);

for (; ; )
OSSched();
}


[This message has been edited by ryanjpcush (edited June 15, 2004).]

[This message has been edited by ryanjpcush (edited June 15, 2004).]

[This message has been edited by ryanjpcush (edited June 15, 2004).]

ryanjpcush
 
Posts: 3
Joined: Mon Jun 14, 2004 11:00 pm
Location: Ireland

Re: Simple Salvo Problem

Postby aek » Tue Jun 15, 2004 8:16 am

I'm not familiar with that board -- are you sure that the LEDs turn on when you write a 1 to the port pins?

Right now, assuming the extraneous calls to InitPORT() and Init() aren't conflicting with what you want to do, the application is simply switching between TaskCount() and TaskShow(), and is always writing 0xFF to PORTB and PORTC.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Simple Salvo Problem

Postby aek » Wed Jun 16, 2004 12:46 am

Never have any problem with LEDs ... exept on those PICs that have their I/Os default to analog pins (and not digital) on certain ports ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Simple Salvo Problem

Postby ryanjpcush » Wed Jun 16, 2004 2:33 am

Yes if I normally write a 1 to the pins they turn on (not using salvo)
And yes the two tasks simply switch from one to the other but even if I comment out the OS_Yield(TaskCount1); for example so only the first task runs I still get the same problem...

Any ideas...... do you have any bother like this with leds??

Thanks

ryanjpcush
 
Posts: 3
Joined: Mon Jun 14, 2004 11:00 pm
Location: Ireland


Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron