Author |
Message |
Topic: How can i make here an subroutine to reduce code size? |
Alex N
Replies: 6
Views: 10603
|
Forum: General CCS C Discussion Posted: Mon Feb 27, 2006 8:32 am Subject: How can i make here an subroutine to reduce code size? |
Rwyoung, thank you for the useful information. It turned out, that my compiler (as opposed to the help index) also supports output_toggle function. |
Topic: How can i make here an subroutine to reduce code size? |
Alex N
Replies: 6
Views: 10603
|
Forum: General CCS C Discussion Posted: Mon Feb 27, 2006 8:17 am Subject: How can i make here an subroutine to reduce code size? |
[spam], if you press the 1 key and RELAIS_K1 is low, !input(RELAIS_K1) is high, which is placed to RELAIS_K1. Pay attention to !input. |
Topic: How can i make here an subroutine to reduce code size? |
Alex N
Replies: 6
Views: 10603
|
Forum: General CCS C Discussion Posted: Mon Feb 27, 2006 7:48 am Subject: How can i make here an subroutine to reduce code size? |
Try to use
case 'x':
output_bit(RELAIS_Kx,!input(RELAIS_Kx));
break;
where 1, 2, 3 and 4 should be instead of x. |
Topic: Interrupt Priority Settings |
Alex N
Replies: 7
Views: 13302
|
Forum: General CCS C Discussion Posted: Mon Feb 27, 2006 7:42 am Subject: Interrupt Priority Settings |
My version of compiler 3.222 has no HIGH option. So, it's time to think about version update. |
Topic: Interrupt Priority Settings |
Alex N
Replies: 7
Views: 13302
|
Forum: General CCS C Discussion Posted: Wed Feb 22, 2006 7:39 am Subject: Interrupt Priority Settings |
Thushi, here are a bit different interrupts, but the code shows, how to set priorities.
#include <18F1320.h>
#device HIGH_INTS=TRUE
#fuses HS
#fuses BORV42, BROWNOUT, PUT
#fuses NOWDT
... |
Topic: usart config at runtime |
Alex N
Replies: 5
Views: 7627
|
Forum: General CCS C Discussion Posted: Wed Feb 15, 2006 8:01 am Subject: usart config at runtime |
This is a similar topic:
http://www.ccsinfo.com/forum/viewtopic.php?t=22062 |
Topic: usart config at runtime |
Alex N
Replies: 5
Views: 7627
|
Forum: General CCS C Discussion Posted: Tue Feb 14, 2006 10:56 am Subject: usart config at runtime |
Is it enough for your task to make some output streams with different settings and switch between them at runtime? |
Topic: About LIN BUS 2.0 |
Alex N
Replies: 28
Views: 31373
|
Forum: General CCS C Discussion Posted: Mon Feb 13, 2006 2:44 pm Subject: About LIN BUS 2.0 |
Good luck! |
Topic: About LIN BUS 2.0 |
Alex N
Replies: 28
Views: 31373
|
Forum: General CCS C Discussion Posted: Mon Feb 13, 2006 2:43 pm Subject: About LIN BUS 2.0 |
LIN.c
// LIN Functions
linStatus linSetup(void)
{
OpenUSART(USART_TX_INT_OFF & USART_RX_INT_OFF & USART_ASYNCH_MODE &
USART_EIGHT_BIT & USART_ ... |
Topic: About LIN BUS 2.0 |
Alex N
Replies: 28
Views: 31373
|
Forum: General CCS C Discussion Posted: Mon Feb 13, 2006 2:41 pm Subject: About LIN BUS 2.0 |
USART.c
// Hardware USART Functions
/********************************************************************
* Function Name: OpenUSART *
* Retur ... |
Topic: About LIN BUS 2.0 |
Alex N
Replies: 28
Views: 31373
|
Forum: General CCS C Discussion Posted: Mon Feb 13, 2006 2:40 pm Subject: About LIN BUS 2.0 |
Board.c
// PIC Board
void B_FlashOnStart()
{
const int8 FlashTime = 100;
int i = 0;
for(i=0; i<=1; i++)
{
output_high(G2_LED);
... |
Topic: About LIN BUS 2.0 |
Alex N
Replies: 28
Views: 31373
|
Forum: General CCS C Discussion Posted: Mon Feb 13, 2006 2:28 pm Subject: About LIN BUS 2.0 |
Board.h
// PIC Board
#include <18F4680.h>
#fuses H4, WDT4096, NOPROTECT
#use delay(clock=40000000)
// Settings for RS-232
#use rs232(baud=9600, xmit=PIN_B0, rcv=PIN_B1, ... |
Topic: About LIN BUS 2.0 |
Alex N
Replies: 28
Views: 31373
|
Forum: General CCS C Discussion Posted: Mon Feb 13, 2006 2:19 pm Subject: About LIN BUS 2.0 |
Main file
// Main program file (LIN)
// Header files
#include "Board.h"
#include "Timers.h"
#include "HW.h"
#include "USART.h"
#include & ... |
Topic: About LIN BUS 2.0 |
Alex N
Replies: 28
Views: 31373
|
Forum: General CCS C Discussion Posted: Mon Feb 13, 2006 2:17 pm Subject: About LIN BUS 2.0 |
Fabri,
A code, which I am giving you now, is for LIN Master node. You can see the LIN Master messages via RS-232 and Serial Port Monitor. It should be repeated sequence
00 55 C4 00 00 FF
00 55 ... |
Topic: About LIN BUS 2.0 |
Alex N
Replies: 28
Views: 31373
|
Forum: General CCS C Discussion Posted: Sat Feb 11, 2006 5:16 am Subject: About LIN BUS 2.0 |
Hi Fabri,
Yes, it's OK. Do you have any tool to monitor LIN bus activity? |
|