Go to Post "which came first, the hamster or the toad?" - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
View Poll Results: What On Chip Peripherals do you use?
UART(serial) 19 61.29%
(E)CCPs 9 29.03%
ADCs 25 80.65%
External Interrupts(PORTB) 21 67.74%
Timers (TMRx) 21 67.74%
Other 6 19.35%
None 3 9.68%
Multiple Choice Poll. Voters: 31. You may not vote on this poll

Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-03-2007, 07:19
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Do you use on-chip peripherals?

The Question is.... Do you use any on-chip peripherals? Which ones? None? Interrupts? Do you understand em? How do you implement them? Experiences? Thoughts?

Choices: UART(serial), (E)CCPs, ADCs, External Interrupts(PORTB), Timers, None, Other

1024 uses every one in the book.... and hasnt been disappointed.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08

Last edited by Qbranch : 16-03-2007 at 07:24.
  #2   Spotlight this post!  
Unread 16-03-2007, 13:03
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Do you use on-chip peripherals?

So far, we've only used the Timers and External Interrupts on the actual robot. We plan to use all of the first five on the next one, though.
__________________
Code:
void function(void)
 {
  function();
 }
  #3   Spotlight this post!  
Unread 16-03-2007, 14:02
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: Do you use on-chip peripherals?

We are gradually getting more sophisticated.

Serial Ports: We have always used the serial ports indirectly (through Kevin's code and the Camera code). No custom modification.

Timers: We have always used the timers to give us a higher resolution clock and provide activity scheduling.

Interrupts: We have always used interrupts 1,2 for drive odometry. We have on occasion used the other 4 interrupts for various purposes.

eeprom: This year we are using the eeprom to store arm position values. This is our first year using the eeprom.

ADC: In previous years, we have made better use of the ADC via Kevin's code. We used it to experiment with the gyro among other things.

IIc: we investigated this to prove that it couldn't possibly by used due to the RC architecture. This year we simulated it using digital I/O.

ccps: - we looked at using them last year to help in determining rotation direction (for the gear tooth sensor on the drive motor), and for determining rotation speed of our ball shooter's impeller wheels. Ultimately we did not use them (didn't care about direction, used a custom circuit to determine shooter speed)

What other on-chip periperal do you use?
  #4   Spotlight this post!  
Unread 16-03-2007, 21:34
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Do you use on-chip peripherals?

Just the ones listed above...

We used an interesting combination of hardware this year on our traction motors... used TMR3 to feed CCP1,2, and 3. CCP1 provided a 100Hz cycle to clock our PWM/PID for the traction motor victors. In this 100Hz routine we sample both the analog encoders and do a state decode on them to figure which way they are going, and handle 5 to 0 and 0 to 5 volt transitions, as well as handling the PID... worked out great, got the timebase as well as the duty cycle time for both victors out of just TMR3.... which we never stop, set, or in any way touch... it just freeruns... now THAT gets my blood going!

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #5   Spotlight this post!  
Unread 16-03-2007, 22:15
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Do you use on-chip peripherals?

Our software is much more sophisticated this year; last year we had a *loop-based* dead reckoning auton mode. This year, I have serial and eeprom as the main attractions to my code. We are using encoders, so I guess that would fall under interrupts.

Sorry if I'm a little short on details...I wouldn't want to give it all away!

JBot
__________________
Aren't signatures a bit outdated?
  #6   Spotlight this post!  
Unread 18-03-2007, 15:47
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Do you use on-chip peripherals?

This year, we're light on sensors. Only 2 pots, a limit switch, 2 banners, and the camera.

I would, however, like to add a real-time clock to the mix, at least for autonomous. A handy thing to have.
  #7   Spotlight this post!  
Unread 18-03-2007, 16:04
Spencer E.'s Avatar
Spencer E. Spencer E. is offline
Android junkie
FRC #1305 (NNSRI Ice3 (cubed))
Team Role: Alumni
 
Join Date: Apr 2005
Rookie Year: 2004
Location: Ontario, Canada
Posts: 91
Spencer E. has a spectacular aura aboutSpencer E. has a spectacular aura about
Send a message via MSN to Spencer E.
Re: Do you use on-chip peripherals?

Thanks to the help from Qbranch I was able to get a hardware timer working to make our arm move for a specific time. I was also using gear tooth sensors (2 interrupts) for use on our transmissions but later figured out I didn't need them.
  #8   Spotlight this post!  
Unread 18-03-2007, 16:07
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Do you use on-chip peripherals?

Has anyone made a list of what peripherals are available on the RC?
  #9   Spotlight this post!  
Unread 18-03-2007, 17:00
Spencer E.'s Avatar
Spencer E. Spencer E. is offline
Android junkie
FRC #1305 (NNSRI Ice3 (cubed))
Team Role: Alumni
 
Join Date: Apr 2005
Rookie Year: 2004
Location: Ontario, Canada
Posts: 91
Spencer E. has a spectacular aura aboutSpencer E. has a spectacular aura about
Send a message via MSN to Spencer E.
Re: Do you use on-chip peripherals?

Quote:
Originally Posted by Astronouth7303 View Post
Has anyone made a list of what peripherals are available on the RC?
A list of all the functions summarized from the PIC data sheet would be an amazing asset to have, especially to newer programmers.
  #10   Spotlight this post!  
Unread 18-03-2007, 17:09
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
Re: Do you use on-chip peripherals?

We used eeprom and serial port to tune our arm PID.
__________________
Real programmers use vim.
  #11   Spotlight this post!  
Unread 07-04-2007, 21:14
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Do you use on-chip peripherals?

Due to popular demand... I made up this list of all the on chip peripherals available for use as the chip is implemented in the '07 rc, and listed the page numbers where you can find info in the User's Manual available here:

> 2 UARTS - Hardware Serial Ports - One is brought out to the Program port, the other is connected to the TTL port. (page 249)

> 2 CCPs and 3 ECCPs - (Enhanced)Capture/Compare/PWM modules - Four of the CCPs are brought out to pwms 13-16. Because of this, the 'Capture' mode for the (e)ccps cannot be used since the procesor's pins sit behind a signal driver on the PWM pins. Programmers can still use these pins for output and generate their own pwm signals, either using the hardware setup for pwm (the rate is too high to drive a victor, so be careful) or can be used in conjunction with another CCP serving as a timebase to generate a razor-sharp high accuracy SIXTEEN BIT pwm signal... being sixteen times the resolution of a standard pwm. The 'Compare' mode of the PWM serves as a kind of hardware equality test for a timer, interrupting on a given value for a timer. Keep in mind TMR3CON holds the bits that direct which CCPs can view which timer's values, also remember that the best way to use a ccp is to never reset, stop, or set the timer's value, just let it freerun. If you want to know more on that, ask me, or read up on unsigned binary addition and subtraction. (page 181 for CCPs, page 189 for ECCPs)

> 2 I2C(inter integrated circuit)/SPI(serial peripheral interface) - Already implemented as a communication bus between the user and master processors. (page 207)

> 1 ADC with a 16 line multiplexer - 1 Analog to Digital converter that can read voltages, a driver is provided by IFI so you don't have to handle the actual hardware. The processor has an internal input mux that allows the single ADC module to read any one of 16 inputs, one at a time. These are often used with a Potentiometer to read in position feedback data or other data input. (page 273)

> PORTB special features
+ 4 Unique external interrupts with programmable edge trigger direction - the first four pins on port b (the last two of which (RB2 and RB3) are avalable as Digital I/O 1 and 2) which have an individual interrupt flag for each pin and can be programmed to edge trigger on a low-to-high or high-to-low transition. very useful with encoders, ultrasonic sensors, any one of a plethora of sensing situations. especially useful for pulse timing when an input capture is not available. (pages 140, 123-125)
+ 4 Grouped external interrupt on change pins - the last four pins of PORTB (RB4,5,6,7 or Digital I/O 3,4,5,6) have one interrupt flag if any number of the pins have a high to low OR low to high transition... it is not programmable. also, once in the interrupt, you'll have to figure out which pin changed programmatically since theres only one flag for all four pins if your using more than one. If you use these external interrupts, above all, remember this: if you don't read portb, you'll be in whats called a "Mismatch Condition" in the silicon of the chip, causing the port to continually interrupt over and over and over. To solve this, just make sure you read or write portb in your interrupt service routine. (pages 140, 123-125)

> 2 Analog Comparators - Used for seeing which of two voltages is greater without actually getting the values of them, a much faster process than full analog to digital conversion. (page 283)

> 2 8bit and 3 16bit Timers - These all have varying characteristics, but for the most part, they incorporate a prescaler which divides down off of a 10MHz clock for the rate at which the timer's 8 or 16 bit counter increments. The 16 bit timers have the neat option of doing a 16 bit read.... when one reads the low byte of the timer (TMRxL) the high byte is instantly copied, in hardware, to a register which is then read as the high byte of the timer (TMRxH). TMR3CON, the control register for timer three, has the extra responsibility for directing the data from the timers to CCP modules, the programmer can change where they go to. Remember, timer 0 is the most flexible timer available since it is the original. (pages 163-180)

> 1024bytes of EEPROM - Electrically Eraseable/Programmable Memory - A few control registers control reading and writing to this static memory which doesnt erase when the processor is shut off, good for storing data from during a match or keeping configuration values, autonomous programs, etc. Remember: this memory is slow. (page 113)

> 8x8 Hardware Multiply - This allows a byte to be multiplied by another in hardware, a function controlled by the compiler but if an extreme speed multiply is needed using this in assembly results in a single-cycle multiply. A VERY nifty feature. (page 119)

> General I/O notes - The chip has 70 I/O pins that can be configured individually as an Input (1) or Output (0) by setting their Tristate (TRISx) value. The IFI board on which the processor is installed pulls up all the Digital I/O lines so they float at about 3v, and have a normal state of 1, so watch that in your logic, remember when a signal line is connected to ground it is zero, when it isnt its one. When configured as an output, each individual pin can drive 25mA... a defining feature of microchip microprocessors.

Again, here's the link to the user's manual for the chip.

------
Well I think that about sums up what i have in my head. If you need any additional help just give me a yell on this thread or otherwise, a positive rep never hurts if you found this useful, and I'll see you all in atlanta.... just give me a yell there and ask anyone on 1024 for "Q", they'll point you in the right direction.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
If you have to use dial-up, don't use NetZero JBotAlan Chit-Chat 7 18-12-2006 01:39
which button machine do you use and do you like it? KenWittlief General Forum 10 16-10-2003 00:01
Gyro Chip: How To Use archiver 1999 3 23-06-2002 21:57
Have YOU used the gyro chip? FotoPlasma Technical Discussion 10 31-01-2002 13:26


All times are GMT -5. The time now is 20:21.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi