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

Problems with the dsPICDEM-Board

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







Problems with the dsPICDEM-Board
PostPosted: Fri Feb 29, 2008 5:38 am     Reply with quote

Hey guys

I bought the dsPICDEM-Board and now I program the SPI with
Code:
#use spi(FORCE_HW, BITS=16, STREAM=SPI_STREAM)
because I need the SPI for the LCD-Display. And the problem is that i get a clock but my data won´t get send. And I also programmed the LED. If i use
Code:
 #use spi(FORCE_HW, BITS=16, STREAM=SPI_STREAM)
the stop lighting, and if i use
Code:
setup_spi
, the LEDs lights but there is no clock and data for the SPI.
Can somebody help me please?

JaKO
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 29, 2008 4:11 pm     Reply with quote

Quote:
I bought the dsPICDEM-Board

There are a large number of dsPICDEM boards. Which one do you have ?
See this link:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2519&param=en025319&page=wwwdsPICDSCDemo
JaKo
Guest







dsPICDEM BOard
PostPosted: Tue Mar 04, 2008 6:36 am     Reply with quote

dsPICDEM2 DM300018

JaKo
JaKo
Guest







Source code
PostPosted: Tue Mar 04, 2008 7:01 am     Reply with quote

That´s my source code:

Quote:
#include<30F4011.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
#use rs232(baud=9600, UART1)
#use spi(FORCE_HW, BITS=16, STREAM=SPI_STREAM)

#define LCDLINE1CMD 0x80;


void main()
{
while(1)
{
unsigned char DisplayData[] = "Das dsPICDEM2 ";
int8 x;

// char c;
// c="A";

delay_ms(250);
output_high(PIN_B0);
output_low(PIN_B1);
delay_ms(250);
output_high(PIN_B1);
output_low(PIN_B0);

SETUP_SPI(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_64);
SPI_WRITE(DisplayData);
x=SPI_READ(0);


}

}


PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 04, 2008 12:35 pm     Reply with quote

Here's the page for that board.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en023561

The User's Guide explains how to write a driver for the LCD controller
in this section. But, they don't tell you what SPI mode is required.
Here is the section in the manual that tells how to program the LCD.
Quote:
B.3 LCD SOFTWARE SPECIFICATION


The page above also has a download called "Software Files". It contains
sample C source code for the LCD driver. The filename is SPI_for_LCD.c.
It contains these functions:
Quote:
SPI_Init(void)
WriteSPI_to_LCD(void)

It mostly consists of low-level code that writes directly to dsPIC registers.
You could translate it to CCS.

I don't have the PCD compiler, and I don't have time to translate these
routines for you now. I can't really help much more.
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