|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#151
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Does this mean that the resolution that IFI published to "fix" the 8.3 volt problem does not work. They recommend changing a high chuck of memory (0xF00 - 0xF5f) to "PROTECTED".
|
|
#152
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
I just thought it was interesting that a bug in my code could induce the same symptom that teams saw two years ago. Although I know how to fix it, I'm not sure I know exactly what caused it. For my own edification I'd like to track it down because it's not obvious to me what is causing it by examining the source code. -Kevin Last edited by Kevin Watson : 11-01-2008 at 16:39. |
|
#153
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
BTW, I fully understand your need to know exactly why this problem happens and just knowing how to fix it isn't enough. ![]() |
|
#154
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
|
#155
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
|
|
#156
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
There seems to be something amiss when using the combination of MPLAB 8.0, C18 V2.4, the V2.4 beta code and the MPLAB SIM debugger. I think that's a "legal" combination, right? The simulator seems to be going off into the weeds when it hits line 373 (serial port enable) of serial_ports.c. The odd thing is that if you step through it it hangs up on that line, but if you let it run it instead hangs up on line 427 of ifi_frc.c, which is _do_cinit();
Is this just a question of the beta code not supporting MPLAB SIM? I don't think I've seen any _SIMULATOR definitions in either the 2.4 or the 3.1 beta code. Edit: The same thing happens when I run the 3.1 beta code with C18 v3.1. Maybe I'm the only one trying to use MPLAB SIM? It worked like a champ with last year's code. Last edited by ayeckley : 09-01-2008 at 23:11. Reason: Additional info |
|
#157
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
that we ran into using the 2006 controller in the game Aim High. If may have helped some teams, but it did not fix things for us and I am aware of some other teams that it did not fix the problem for as well. We will happily try zeroizing all of memory at startup if we see 8.3 showing up in the voltage display during this build season. Eugene |
|
#158
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
Quote:
// initialize memory to all zeros _asm lfsr 0, 0 movlw 0xF clear_loop: clrf POSTINC0, 0 cpfseq FSR0H, 0 bra clear_loop _endasm -Kevin |
|
#159
|
||||||
|
||||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
You can read about what I found in this thread, starting at post 133. http://www.chiefdelphi.com/forums/sh...t=44954&page=9 |
|
#160
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
I am currently in the process of testing the old configure.py makefile with this new code. Has anybody had success?
I use a mac, and seriously do not want to try and update mplab in vmware.. painful memories.. |
|
#161
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Our mistake here is probably very silly and obvious, but the solution eludes us nevertheless.
We're trying to get the gryo and accelerometer working, but we get a build error when we try to use the Get_Analog_Value function. Code:
gyro = Get_Analog_Value(rc_ana_in16); Code:
Error [1105] symbol 'ADC_CH15' has not been defined |
|
#162
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
I am trying to figure out the encoder code, and do not understand how the code knows what way the shaft is turning,
void Int_1_ISR(void) { if(ENCODER_1_PHASE_B_PIN == 0) { Encoder_1_Count -= ENCODER_1_TICK_DELTA; } else { Encoder_1_Count += ENCODER_1_TICK_DELTA; } } What really is ENCODER_1_PHASE_B_PIN? And what port is this interrupt running one Input 1 or 2? Last edited by comphappy : 11-01-2008 at 01:14. |
|
#163
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
When using a "Quadrature" encoder, there are two signals generated, Phase A and Phase B. Both are square waves with "B" 180 degrees out of phase from "A". When triggered by "A" going high, the ISR looks at "B", if it is low, you are going forward, if "B" is high you are going backward. In the code it explains how to attach the A and B phases. Now, if you are not using a quadrature encoder but one with a single output, like the GTS in the kit, then determining direction is a much bigger challenge although, not impossible. |
|
#164
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin Last edited by Kevin Watson : 11-01-2008 at 16:41. |
|
#165
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
Thank you for the diagram it was really useful. (BTW I like your code, it is clean and well organized) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Does the camera code suits to all versions of MPLAB and C18? | razer | Programming | 3 | 04-01-2007 14:50 |
| Trying to follow C18 interrupt context code... | dcbrown | Programming | 5 | 21-12-2006 09:01 |
| Error w/ FRC code | JamesBrown | Programming | 2 | 08-01-2005 16:17 |
| Programming code Fix FRC | Ferazel2001 | Programming | 6 | 08-02-2004 02:46 |
| FRC default code | hedgehogger | Programming | 2 | 21-01-2004 18:41 |