Download presentation
Presentation is loading. Please wait.
Published byEileen Nichols Modified over 9 years ago
1
Inside the dsPIC33FJ256GP710
2
Let’s call it a dsPIC33 PIC uC series made by Microchip Compiler, simulator, other goodies are free Programmable in C Can use SALVO real-time OS 16-bit architecture
3
Handy features Watchdog timer Brown-out reset Power-saving modes And…
4
Vast amounts of I/O
5
2 SPI channels 2 UARTs 2 I 2 C channels 2 ECAN channels (can’t really use these) 10s of other pins (timers, ADCs, etc)
7
A torrent of bits STEIN: 16 bits per particle event, 80K events/sec at peak (1.280 Mbps); 8 kbps average MAGIC: 19 bits per measurement per axis, 10 measurements/sec on 3 axes (plus 1 byte/sec to measure temperature) Storage: SD card, everything has to be put in then taken out at 1 Mbps
8
Interface choice UART: one-to-one, minor overhead I 2 C: arbitration, addressing, 400 kbps max; multimaster capable bus SPI: inter-chip shift register, goes as fast as your system can take; one-to-many with chip select lines
9
SPI
10
Keeping up with SPI Transfers up to 1 bit per clock cycle Feeding manually – 1 word every 16 cycles Simultaneous receiving and transmitting?!
11
Direct Memory Access (DMA)
12
RAM peripherals Transmit buffer replenished from memory Receive buffer copied to memory Set it up, let it go 2K bytes of DMA-capable RAM to work with 8 DMA channels (can’t operate simultaneously)
13
Using DMA Associate DMA channel with peripheral and memory address Define number of bytes to send/receive Initiate first transfer (if sending) Interrupt will be issued when transfer is complete or half-complete
14
Connecting the SD card SD cards can use SPI natively Data is transmitted in blocks of 1-512 bytes Some overhead per transmission, so maximum speed uses 512 byte blocks
15
Connecting the SD card Read overhead: ~18 bytes/block Write overhead: ~17 bytes/block + write time Small block sizes are a waste; design for larger blocks (512 bytes -> ~4300 cycles total)
16
Connecting the SD card SPI is a shift register, so it needs input even when receiving Two DMA channels needed: send and receive Large DMA buffer only needed for active operation i.e. sending or receiving
17
Space constraints We’d like to make a lot of 512-byte buffers on the dsPIC33, but the DMA space is only 2K How to store the data? – Store data raw on card? – makes getting a particular sensor’s data very hard – Assign fixed space for each sensor? – requires buffering of some sensors’ data to lessen SD card communication overhead
18
Additional data streams Housekeeping/engineering data – Power supply data – Temperature sensors – Data rates Timestamps Sun sensor Radio commands (~10 KB/sec)
19
Current connection plan PIC – engineering radio via UART PIC – power supply via I 2 C PIC – SD card via SPI PIC – FPGA via SPI FPGA – MAGIC via SPI FPGA – STEIN via SPI PIC – MAGIC via bitbang SPI (emerg. backup)
21
Other considerations Program stored in flash, accessible from software (self-reprogramming) Serial memory on daughterboard – save new firmware as it’s sent
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.