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

Embedded C Dev Kit

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



Joined: 23 Oct 2019
Posts: 3

View user's profile Send private message

Embedded C Dev Kit
PostPosted: Wed Oct 23, 2019 9:31 am     Reply with quote

I am working through the examples/lessons and during lesson 7 i am not able to get the 7 segment display to light up. I am not seeing any errors when i build/compile and run the program.
Code:

/*     ccscana.c     */
#include <18f45k80.h>
#device ICD=TRUE
#fuses NOPROTECT,NOWDT
#use delay(clock=64MHz,crystal=16MHz)

#define CAN_BRG_PRESCALAR        15
#define CAN_BRG_PHASE_SEGMENT_1  6
#define CAN_BRG_PHASE_SEGMENT_2  6
#define CAN_BRG_PROPOGATION_TIME 0
#define CAN_BRG_SYNCH_JUMP_WIDTH 0
#include <can-18F4580.c>

#define WRITE_REGISTER_D_ID 0x400

void write_7_segment(int value) {
   const int lcd_seg[10]={0x40,0x79,0x24,0x30,0x19,
                          0x12,0x02,0x78,0x00,0x10};
   int buffer[3];
   
   buffer[0]=0x1E;
   buffer[1]=0x7F;
   buffer[2]=lcd_seg[value];
   can_putd(WRITE_REGISTER_D_ID,buffer,3,1,TRUE,FALSE);
}


/*      ex6.c        */
#include "ccscana.c"

void main(void){
   int i=0;
   
   can_init();
   can_putd(0x100,0,0,1,TRUE,FALSE); //send an on-bus message
                                     //to wake up MCP250x0's
   delay_ms(1000);                   //wait for node c to power-up
   
   while(true){
      write_7_segment(i);
      delay_ms(1000);
      if(++i==10)
         i=0;
   }
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 23, 2019 1:18 pm     Reply with quote

What CCS development board do you have ?

What book do you have ? What chapter or page number are you looking at ?
Magnifico



Joined: 23 Oct 2019
Posts: 3

View user's profile Send private message

PostPosted: Tue Oct 29, 2019 4:50 pm     Reply with quote

ICD-U64 with Development Kit for the PIC MCU. The Can BUS exercise book, Example number 6.

The board has the 18F45k80 and the 16f1936 nodes and a MCP2515 and MCP25050 chip on there.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 30, 2019 4:33 am     Reply with quote

The only manual I can find for this board on the net has a 2010 date.
The board you have is a newer model. So I don't think I can help.
I suggest you contact CCS support.
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