| PAGES: «prev 1 2 3 4 next» |
|
| |
Storm
|
re: Commiserations :( |
|
This has happened everywhere. We may as well give congratulations to the entire forum
Oh, and by the way, welcome Volacide and Blue Variant. Two excellent choices. ------------------- | |
quote quick quote edit quick edit del posts in thread report
| |
Empress Dowager Lu
|
re: Commiserations :( |
|
I like kitties.
------------------- so when the devil wants to dance with you, you better say never
because a dance with the devil might last you forever | |
quote quick quote edit quick edit del posts in thread report
| |
mettaur
|
re: Commiserations :( |
|
That was...random, EDL...
And...we're doomed now that the clones attack! ------------------- | |
quote quick quote edit quick edit del posts in thread report
| |
Circut GX
|
re: Commiserations :( |
|
OH NOZE!!!1
NOT ANOTHER CLONE WAR!!1 ![]() ![]() ------------------- | |
quote quick quote edit quick edit del posts in thread report
| |
volacide
|
re: Commiserations :( |
|
TRANSMISSION!
THIRD WORLD WAR. THIRD ROUND. A DECADE OF THE WEAPON OF SOUND. ABOVE GROUND. NO SHELTER IF YOU'RE LOOKING FOR SHADE. I LICK SHOTS AT THE BRUTAL SHARADE! word | |
quote quick quote edit quick edit del posts in thread report
| |
George
|
re: Commiserations :( |
|
Someone should pin this congratulations thread!
------------------- | |
quote quick quote edit quick edit del posts in thread report
| |
volacide
|
re: Commiserations :( |
|
Damn't! volacide got to it before me! *bleep*
| |
quote quick quote edit quick edit del posts in thread report
| |
Alias353
|
re: Commiserations :( |
|
Both of you guys are a *bleep*ing joke.
I liked it better when Sixth and Kuldahar moderated the place. | |
quote quick quote edit quick edit del posts in thread report
| |
Paineh
|
re: Commiserations :( |
|
Thats like the first time you've signed in that in how long Vol?
Lol at this being stickied. | |
quote quick quote edit quick edit del posts in thread report
| |
mettaur
|
re: Commiserations :( |
|
Every moderated forum gets this treatment (double mods). Was this Redemption's idea of saying "happy new year"?
------------------- | |
quote quick quote edit quick edit del posts in thread report
| |
volacide
|
re: Commiserations :( |
|
I dunno, a couple of months.
| |
quote quick quote edit quick edit del posts in thread report
| |
Paineh
|
re: Commiserations :( |
quote mettaur_15It isn't a treatment lol, its a bug. It'll be fixed as soon as one of the staff come on. I for one am glad that people are taking this in a light hearted member. Stops people saying that all mods are robots lol. Only that? I thought it would be longer lol.:/ | |
quote quick quote edit quick edit del posts in thread report
| |
volacide
|
re: Commiserations :( |
|
// call ser_init to initial hardware serial as: ser_init(SER_115200) //
void ser_init(char spbrg_val) { SSPCON = 0; PIR1 = 0; // this ensures also RCIF = TXIF = 0; clear_bit(PIE1,5); //RCIE = 0; clear_bit(PIE1,4); //TXIE = 0; TRISC = TRISC | 0xC0; // setup TRISC for USART use SPBRG = spbrg_val; TXSTA = 000100100b; // txen, brgh RCSTA = 010010000b; // spen and cren, the rest all off ser_tmp = RCREG; // flush the rx buffer ser_tmp = RCREG; ser_tmp = RCREG; } // low-level call to send a character serially. void ser_tx(char c) { //wait for txif to go hi while (!(PIR1 & 16)) ; //while (!TXIF); //disable_interrupt(GIE); //? TXREG = c; //enable_interrupt(GIE); //? } void ser_putstring(const char* text) { char i = 0; while( text[i] != 0 ) ser_tx( text[i++] ); } // writes a character out the serial port as a 3 digit number void ser_writechar(char data) { ser_tx( '0' + data/100 ); ser_tx( '0' + (data%100)/10 ); ser_tx( '0' + data%10 ); } // this is a blocking receive // char ser_rcv(void) { while (1) { if (RCSTA & 2) { // RCSTA bit 1 is overflow error // overflow error clear_bit(RCSTA,CREN); // CREN is RCStatus bit 4 // ser_tmp = RCREG; // flush the rx buffer ser_tmp = RCREG; ser_tmp = RCREG; set_bit(RCSTA,CREN); // CREN = 1; } else if (RCSTA & 4) { // RCSTA bit 2 is framing error // framing error ser_tmp = RCREG; } else if (PIR1 & 32) { // PIR1 bit 5 is RCIF ser_tmp = RCREG; return ser_tmp; } } } // nonblocking receive returns 0 for any error, including nothing to read char ser_rcv_nb(void) { if (PIR1 & 32) { ser_tmp = RCREG; return ser_tmp; } else { return 0; } } // this next section is for servo control ///////////// char servo_state = 0; char servo_curr = 0; char servo_mask = 11111111b; // default that all of portD will be // used for servo operations rather // than direct digital output twiddling char servo_switch = 1; char servo_pos[8] = {0,0,0,0,0,0,0,0}; char _servo_free = 0; void servo_init(void) { OPTION_REG = 132; // bit 7 = 1 for portB pull-up and bit2 is for prescaler // TMR0 @ 1:32, prescaler to timer0 (for servo control) TRISD = 0; // port D as outputs for servo commands! // in fact we already do this in init_cerebellum(); we do it again for // // redundancy only here // set_bit(INTCON, T0IE); //T0IE = 1 ie enable TMR0 overflow bit - T0IE is bit 5 delay_ms(1); } void do_servo(void) { clear_bit(_servo_free,0); // the bit 0 of servo_free = 0; if (servo_state == 1) { // next intr in 0.6 ms TMR0 = 153; //TMR0 = 145; if ((servo_pos[servo_curr] != 0) && ((servo_mask & servo_switch) != 0)) PORTD |= servo_switch; // output hi to specific servo pin out servo_state = 2; set_bit(_servo_free,0); // the bit servo_free = 1; } else if (servo_state == 2) { TMR0 = 255 - servo_pos[servo_curr]; servo_state = 3; } else if (servo_state == 3) { if ((servo_mask & servo_switch) != 0) PORTD &= ~servo_switch; // output lo to this servo bit, but // preserve all other digital hi's on port D TMR0 = servo_pos[servo_curr]; servo_curr = servo_curr + 1; servo_curr = servo_curr & 0x07; // increment to next servo, mod 8 // servo_switch = servo_switch << 1; if (servo_switch == 0) servo_switch = 1; // increment to next servo port bit // servo_state = 1; } clear_bit(INTCON, 2); // clear T0IF = 0; } // end of servo control // Analog-digital converter code ////////////////// char ADCON0@0x1f; char ADRESH@0x1e; char ADCON1@0x9f; // this is called with a character 0 through 7 and returns // an analog-digital reading char adc_read(char ch) { ADCON0 = (ch << 3) & 56; // shift ch to correct bit position ADCON0 |= 0x81; // Tad = Fosc/32, ADC on. delay_us(12); // wait for Tacq ADCON0 |= 4; // acquire go! while (ADCON0 & 4); // wait for AD to complete delay_us(4); // wait for 2Tad return ADRESH; // return captured value } // End of Analog-Digital conversion code ////////////// // PWM Motor code ////////////// //globals for motor PWM control// char ccpcon; char CCP1CON@0x17; char CCP2CON@0x1d; char TMR2@0x11; char PR2@0x92; char CCPR1L@0x15; char CCPR2L@0x1b; char T2CON@0x12; char PORTC@0x07; void pwm_init(void) { // init hardware PWM CCP1CON = 0; // CCP off CCP2CON = 0; TMR2 = 0; PR2 = 0xff; // 0x3f: 78kHz, 0xff: 19.5kHz CCPR1L = 0; // actually, I don't think the output is inverted! 0 = stop. CCPR2L = 0; TRISC = TRISC & 11011000b; // set DC motor pins to output clear_bit(TRISB,1); // clear for motor direction output lines - chnged 0 to 1 illah 1/16/03 clear_bit(TRISA,4); // clear for motor direction output lines ccpcon = 00111100b; // setup reg mask CCP1CON = ccpcon; // CCP module to PWM mode CCP2CON = ccpcon; set_bit(T2CON,TMR2ON); } // parameters are motor number (0 or 1), direction (0 or 1) and speed // // presumes that port c, bits 5 and 0 are being used for this. void pwm_setvel8(char n, char d, char c) { if (n == 0) { if (d == 0) { //set_bit(PORTC,5); set_bit(PORTC,5); clear_bit(PORTB,1); // changed 0 to 1 illah 1/16/2003 } else { //clear_bit(PORTC,5); clear_bit(PORTC,5); set_bit(PORTB,1); // changed 0 to 1 illah 1/16/2003 } CCPR1L = c; } else if (n==1) { if (d == 0) { //set_bit(PORTC,0); set_bit(PORTC,0); clear_bit(PORTA,4); } else { //clear_bit(PORTC,0); clear_bit(PORTC,0); set_bit(PORTA,4); } CCPR2L = c; } } // END of PWM Motor Code /////////////////////// // interrupt handler code // variables for saving state during interrupt handling int save_w; int save_status; //the actual interrupt handler function itself. void interrupt(void) { //store current state of processor asm { movwf _save_w swapf STATUS,W bcf STATUS,5 bcf STATUS,6 movwf _save_status } // end asm if (INTCON & 36) do_servo(); // in other words if (TOIE & TOIF) then do_servo() // // restore processor state asm { swapf _save_status,W movwf STATUS swapf _save_w,F swapf _save_w,W } // end asm } // this initializes the buttons and leds on cerebellum // // this also initializes PortD digital as outputs, for servoes and digital outs // void init_cerebellum(void) { TRISB &= 207; // make port B pins 4 and 5 write-out able for LED's by setting // tristate bits 4 and 5 to zero PORTB &= 207; // turn off yellow and green LED's TRISD = 0; // port D as outputs for Servo cmds and digital output settings } | |
quote quick quote edit quick edit del posts in thread report
| |
mettaur
|
re: Commiserations :( |
|
What language is that, Vol? C?
------------------- | |
quote quick quote edit quick edit del posts in thread report
| |
Empress Dowager Lu
|
re: Commiserations :( |
quote Alias353Hmm, maybe you should be a little less arrogant and get over it. Either that, or go sit in a corner and pout like a wuss. Either way, it's not going to change just because it doesn't please you... so just get used to it. ------------------- so when the devil wants to dance with you, you better say never
because a dance with the devil might last you forever | |
quote quick quote edit quick edit del posts in thread report
| |
| [All dates in (PT) time] | Threads List « Next Newest Next Oldest » |
| PAGES: «prev 1 2 3 4 next» |
Powered by neoforums v0.9.8b (equilibrium)
Copyright Neo Era Media, Inc. 1999-2009