treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Wed Oct 01, 2008 4:53 pm |
|
|
or you may not have to do anything, if there on consecutive ports and in the right order.
Code: | #define FIRM_MAJOR 'C'
#define FIRM_MINOR 05
#define HARD_MAJOR 3
#define HARD_MINOR 03
#include <18F4525.h>
#use delay(clock=10000000, restart_wdt)
#fuses hs,nowdt,noprotect,nolvp,put
#use rs232(baud=19200,xmit=PIN_C0,invert,stream=DEBUG) // stderr(same as debug)
#use rs232(baud=19200,enable=PIN_C5,xmit=PIN_C6,rcv=PIN_C7,stream=CIM) // rs485 is the default
#case
#zero_ram
int16 my_int16;
#byte my_int16 = 0xF80 //note: no semicolin 0xF80= port A0 on a 18F4525
// sencond byte comes from 0xF81 which is port B on a 18F4525
//=== MAIN ===//
void main(void)
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
set_tris_a(0xFF);set_tris_e(0xFF);set_tris_c(0xFF);
set_tris_b(0xFF);set_tris_d(0xFF);port_b_pullups(TRUE);
fprintf(DEBUG,"%lu\n\r",my_int16);
while(1)
{
}
}
|
|
|