Comments (9)
Correction: IDL2 is connected to PB0 (pin 19).
Original comment by [email protected]
on 23 Sep 2011 at 11:03
from gruvin9x.
Original comment by [email protected]
on 23 Sep 2011 at 11:03
- Changed title: V4.0 -- Won't boot if IDL2 switch active.
from gruvin9x.
Pin 19 /SS is tied up with the SPI bus. Said bus is shared with the in-circuit
serial programming bus (ISP). Holding this pin low at start-up must be driving
the ISP system into an inappropriate state.
Regardless, /SS is usually used for SPI chip select operations -- that is, as a
/CS. Note that we have SD_CS connected to PB4 instead, however.
Thus, for both these reasons now understood, we need to swap IDL2 with SD_CS.
Original comment by [email protected]
on 24 Sep 2011 at 2:55
from gruvin9x.
Changes are already done and ready to commit, however we need to find
documentation of this effect the /SS pin is having to be truly sure to avoid
any further disasters. I cannot be happy till I see it in a datasheet. A quick
Google search yeilds nothing, as did a scan through the 2560 datasheet. Need to
find the ISP protocol sheet.
Cam.
Original comment by [email protected]
on 24 Sep 2011 at 11:20
from gruvin9x.
Strange thing is according to the datasheet the SPI hardware is disabled at
boot, and the /SS pin doesn't get used for ISP. Does not compute !
Still looking for the ISP protocol sheet.
Original comment by [email protected]
on 24 Sep 2011 at 11:58
from gruvin9x.
Found the ISP datasheet:
http://www.atmel.com/atmel/acrobat/doc0943.pdf
It makes no mention of the /SS pin, not even as a consideraton. Also the CPU
has to be held in RESET for the ISP to work, so it's hard to imagine that it's
an ISP issue.
Maybe something to do with HVPP (High Voltage Parallel Programming) interface ??
Original comment by [email protected]
on 24 Sep 2011 at 2:02
from gruvin9x.
Found it where I started in the ATMega2560 datasheet:
When the SPI is configured as a Master (MSTR in SPCR is set), the user can
determine the direction of the SS pin.
If SS is configured as an output, the pin is a general output pin which does
not affect the SPI system. Typically, the pin will be driving the SS pin of the
SPI Slave.
If SS is configured as an input, it must be held high to ensure Master SPI
operation. If the SS pin is driven low by peripheral circuitry when the SPI is
configured as a Master with the SS pin defined as an input, the SPI system
interprets this as another master selecting the SPI as a slave and starting to
send data to it. To avoid bus contention, the SPI system takes the following
actions:
1. The MSTR bit in SPCR is cleared and the SPI system becomes a Slave. As a
result of
the SPI becoming a Slave, the MOSI and SCK pins become inputs.
2. The SPIF Flag in SPSR is set, and if the SPI interrupt is enabled, and the
I-bit in SREG is set, the interrupt routine will be executed.
Thus, when interrupt-driven SPI transmission is used in Master mode, and there
exists a possibility that SS is driven low, the interrupt should always check
that the MSTR bit is still set. If the MSTR bit has been cleared by a slave
select, it must be set by the user to re-enable SPI Master mode.
Bugger it's ok as an general purpose output but duff as an input. Please let
this be the last V4.0 error or I may have to tender my resignation :(
Original comment by [email protected]
on 24 Sep 2011 at 2:26
from gruvin9x.
Yup. "Duff as an input". I discovered the same. So it's when the code goes to
initialise the SD card I guess. The SPI bus is stuck in slave mode, which is nt
expected, hence things go bad.
But of course, we need an SD_CS (output) anyway, so we should use this pin as
intended.
Here's how it needs to end up.
Pin 19 (/SS) = SD_CS
Pin 23 (PB4) = IDL2_SW
Pin 25 (OC1B) = PPM_OUT
I'll add Cam's photo of this mod to the Build Your Own Board (PcbAssembly) wiki
page. Thanks Cam.
(We both cut the SD_CS track in about exactly same place, which I found
interesting. Great minds thinking alike? Or just the obvious choice. Perhaps
we'll never know. :P)
Original comment by [email protected]
on 25 Sep 2011 at 12:14
from gruvin9x.
Original comment by [email protected]
on 26 Sep 2011 at 9:15
- Changed state: Verified
from gruvin9x.
Related Issues (20)
- T-Trim switch HOT 8
- source of mix is Channel with FlightPhases HOT 5
- All Switches and Channels on display HOT 22
- Batt Volts calibration (ANA Screen) and BG averaging. HOT 4
- TX Power on ALERT: THR not idle HOT 3
- Flight Phase Name last pixel column interference HOT 2
- Trainer SW in FUNC SWITCHES messed up HOT 14
- TRIM values as inputs.. HOT 10
- Patch for /branches/frsky/src/main_views.cpp HOT 10
- Frsky vario/altimeter reset altitude HOT 9
- Channel order and fail safes HOT 7
- Code not compatible with up-to-date build environment (gcc 4.6.2, avr-libc 1.8.0) HOT 13
- Add 'make fuses' capability to Makefile HOT 1
- Makefile header text is out of date HOT 2
- main_views.cpp telemetry views broken (trunk) HOT 15
- SIMU hangs when trying to format virtual EEPROM HOT 33
- Low bat alarm doesn't sound when voltage is below 4.9V (first noted on frsky/stock board.) HOT 6
- THR and AIL switch HOT 10
- Font colour is no good HOT 4
- Watchdog TImer reboot fails to re-start system properly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gruvin9x.