CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

dsPIC30 RAM-use Problems

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
P51D



Joined: 25 Jan 2010
Posts: 36

View user's profile Send private message

dsPIC30 RAM-use Problems
PostPosted: Mon Feb 08, 2010 4:53 am     Reply with quote

Hello all

I've some interessting problems with the ram-pointer and usage.
if I execute only the main parts, it works. Then I try to add some big arrays:
Code:

int8 delay[600]={...};
int16 dac1[600]={...};
int16 dac2[600]={...}:

Now works only the half of the program. An LCD-output function shows nothing on the lcd and the dac have also not every value.
For example:
Code:

DAC_output(dac1[p] | (1<<12) | (1<<13));
1_DAC_select;
deselect;
DAC_output(dac2[p] | (1<<12) | (1<<13));
2_DAC_select;
deselect;
if(p == 150) p = 0;
else p ++;

The dac has array values from place 0 to ~350 and not 0,1,2,3,4....
it seems like 0,3,4,6,9,...

What is the problem?
The fuses are this way:
Code:

#device DSPIC30F6012A *=16      //16Bit Ram Pointer
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz)
#FUSES PR                       //Promiary Oscillator
#FUSES NOCKSFSM                 //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES WPSB1                    //Watch Dog Timer PreScalar B 1:1
#FUSES WPSA1                    //Watch Dog Timer PreScalar A 1:1
#FUSES PUT64                    //Power On Reset Timer value 64ms
#FUSES BROWNOUT                 //Reset when brownout detected
#FUSES BORV20                   //Brownout reset at 2.0V
#FUSES LPOL_HIGH                //Low-Side Transistors Polarity is Active-High (PWM 0,2,4 and 6)
   //PWM module low side output pins have active high output polar
#FUSES HPOL_HIGH                //High-Side Transistors Polarity is Active-High (PWM 1,3,5 and 7)
   //PWM module high side output pins have active high output polarity
#FUSES NOPWMPIN                 //PWM outputs drive active state upon Reset
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOCOE                    //Device will reset into operational mode
#FUSES ICS0                     //ICD communication channel 0
#FUSES RESERVED                 //Used to set the reserved FUSE bits
#FUSES RESERVED                 //Used to set the reserved FUSE bits

#use delay(clock=20000000)



Thanks for answering.
best regards
P51D
HYDERABADII



Joined: 26 Mar 2010
Posts: 1

View user's profile Send private message

dispic30f6012a configuration settings problem
PostPosted: Fri Mar 26, 2010 3:52 am     Reply with quote

Hello sir,

I'm using dspic30f6012a with your CCS pcwhd v4.093. This one worked well for 16f877a but with dspic30f6012a it is not showing any output. Here is the code.

I want to run this code with fast RC oscillator.
Code:

#include <30F6012a.h>
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES FRC               //Primary Oscillator with PLL
#FUSES NOCKSFSM       //Clock Switching is disabled, fail Safe clock monitor is   disabled
#FUSES WPSB1                   //Watch Dog Timer PreScalar B 1:1
#FUSES WPSA1                  //Watch Dog Timer PreScalar A 1:1
#FUSES PUT4                    //Power On Reset Timer value 4ms
#FUSES NOBROWNOUT               //No Brownout reset
#FUSES BORV20                   //Brownout reset at 2.0V
#FUSES LPOL_HIGH                //Low-Side Transistors Polarity is Active-High (PWM 0,2,4 and 6)
#FUSES HPOL_HIGH          //High-Side Transistors Polarity is Active-High (PWM 1,3,5 and 7)
#FUSES NOPWMPIN                 //PWM outputs drive active state upon Reset
#FUSES NOMCLR                   //Master Clear pin used for I/O
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOCOE                    //Device will reset into operational mode
//#FUSES ICS0                     //ICD communication channel 0
#FUSES RESERVED                 //Used to set the reserved FUSE bits
#use delay(clock=7.37MHZ)

void main(void)
{
OUTPUT_B(PIN_B0|PIN_B1);
OUTPUT_F(PIN_F4 | PIN_F5);
SET_TRIS_b(PIN_B0|PIN_B1);
SETUP_ADC_PORTS(NO_ANALOGS);
while (true)
{
OUTPUT_LOW(PIN_B1);
OUTPUT_LOW(PIN_B0);
OUTPUT_LOW(PIN_F4);
OUTPUT_LOW(PIN_F5);
delay_ms(100);
OUTPUT_HIGH(PIN_B1);
OUTPUT_HIGH(PIN_B0);
OUTPUT_HIGH(PIN_F4);
OUTPUT_HIGH(PIN_F5);
delay_ms(100);
}
}

Plzz reply me as early as possible.

Thank you.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Mar 26, 2010 6:09 am     Reply with quote

I don't see a problem with V4.093 and your code. It's working with MPLAB, thus I expect a hardware problem.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group