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 CCS Technical Support

i need guide - send me the latest example of lcd in pcd

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



Joined: 21 Feb 2008
Posts: 7

View user's profile Send private message

i need guide - send me the latest example of lcd in pcd
PostPosted: Wed Feb 27, 2008 2:44 am     Reply with quote

pls help me
below is my program:



#include "C:\Program Files\PICC\Examples\final.h"
//#include <33FJ256MC710.h> if i m using this i get error why??
#use delay(clock=20000000)
#fuses hs,noprotect,NOWDT



{
set_adc_channel(1); //a1
delay_ms(10);
value1=read_adc();
voltback=xxxx; //calculate equation
printf(lcd_putc, "\fEMF: %f", voltback);

set_adc_channel(0); //a0
delay_ms(10);
value2=read_adc()/2;

if(value2<25)
{
rev();
mtspeed==127*(1-value2/25)/8;

set_pwm_duty(1,mtspeed * (int16)64);
}
else if(value2>=25 && value2<=30)
{
stop();
mtspeed==0;

set_pwm_duty(1,mtspeed * (int16)64);
}
else if(value2>30)
{
fwd();
mtspeed=127*(50-value2)/20/8;

set_pwm_duty(1,mtspeed * (int16)64);
}

delay_ms(100);

} while(1);

}

void fwd()
{
output_high(pin_c1);
output_low(pin_c3);
}
void stop()
{
output_low(pin_c1);
output_low(pin_c3);
}
void rev()
{
output_low(pin_c1);
output_high(pin_c3);
}

---------------------------------------------------------------------------------------------------------------------
HI,
Can anyone help me, to setup lcd for DSP33FJ56MC710. I have try to
use lcd function but can't compile??? showing lcd.c error, why??

#define use_port_lcd TRUE
#include<lcd.c>

#byte PORTD=6

void main()
{ lcd_init();
float voltback;
long value1;


set_tris_d(0);


setup_adc_ports(ALL_ANALOG);
setup_adc(adc_clock_internal);



do
{
set_adc_channel(1); //a1
delay_ms(10);
value1=read_adc();
voltback=xxxx; // calculate equation
printf(lcd_putc, "\fEMF: %f", voltback);


} while(1);

}
in my C:\Program Files\PICC\Examples\EX_ it just have 4 pcm and pch. i still can't find 4 pcd. Can you send me the latest example of lcd in pcd.




Thank you.


Last edited by sivaganapathy on Wed Feb 27, 2008 4:14 am; edited 3 times in total
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Feb 27, 2008 3:53 am     Reply with quote

1) Pls. do not open a new thread for every new problem you have in the same project.
2) If you log in, -being the last in the thread-you can edit/modify/delete your post.

Pls. correct your previous post.

Humberto
sivaganapathy



Joined: 21 Feb 2008
Posts: 7

View user's profile Send private message

Hi Humberto- i have correct it.
PostPosted: Wed Feb 27, 2008 4:17 am     Reply with quote

1) Pls. do not open a new thread for every new problem you have in the same project.
2) If you log in, -being the last in the thread-you can edit/modify/delete your post.

Pls. correct your previous post.


Hi Humberto- i have correct it.

can you help me...
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Feb 27, 2008 5:13 am     Reply with quote

Quote:

#byte PORTD=6

I do not have the compiler for dsp devices support (PCD), but for sure this port address
definition is wrong. It should be mapped at 0x02D4.
You should be aware that PORTD (as other) is a 16 bit wide port in this device, hence the
LCD driver and your whole code should be adapted.

dsPIC30/33 device architecture are 16 bit machines.
By no way trying to copy and paste a code oriented to run in another core could run.

Humberto
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