View previous topic :: View next topic |
Author |
Message |
sivaganapathy
Joined: 21 Feb 2008 Posts: 7
|
i need guide - send me the latest example of lcd in pcd |
Posted: Wed Feb 27, 2008 2:44 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Feb 27, 2008 3:53 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
sivaganapathy
Joined: 21 Feb 2008 Posts: 7
|
Hi Humberto- i have correct it. |
Posted: Wed Feb 27, 2008 4:17 am |
|
|
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... |
|
![](templates/subSilver/images/spacer.gif) |
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Feb 27, 2008 5:13 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|