Changes

Jump to navigation Jump to search
459 bytes added ,  03:21, 29 September 2020
→‎Original Firmware: Document MCC initialization
[[File:OptionBytes.png|none|thumb|ST7 Original Firmware Option Byte Info]]
=== GPIO Initialization ===
* PADDR = 0xF0, PAOR = 0x38 or 0x30 depending on address 0xF3** PA7: Open Drain Output** PA6: Open Drain Output** PA5: Push Pull Output** PA4: Push Pull Output** PA3: Depends on address 0xF3* PBDDR = 0x0F, PBOR=0x1F** PB4 - Pullup interrupt input** PB3 - Push Pull Output** PB2 - Push Pull Output** PB1 - Push Pull Output** PB0 - Push Pull Output* PCDDR = 0x03, PCOR=0x0B** PC7 - floating input** PC6 - floating input** PC5 - floating input** PC4 - floating input** PC3 - pullup input** PC2 - floating input** PC1 - push pull output** PC0 - push pull output* PDDDR = 0x20, PDOR=default to 0x0** PD5 - open drain output** PD4 - floating input** PD3 - floating input** PD2 - floating input** PD1 - floating input** PD0 - floating input* PFDDR = 0x20 or 0x80 depending on address 0xF3, PFOR=0x10 or 0x80 depending on address 0xF3** PF7 - depends on 0xF3** PF6 - floating input** PF5 - depends on 0xF3** PF4 - depends on 0xF3** PF2 - floating input** PF1 - floating input** PF0 - floating input === MCC Initialization ===Done in the main function, MCCSR is initialized to 0x0E. This means: * Clock Prescaler[CP] is set to /2* SlowModeSelect[SMS] is set to 0, so CP is ignored and Fcpu=Fosc2* TimeBase[TB] is 0b11, selecting 25ms timebase* OscillatorInterruptEnable[OIE] is set, has something to do with low-power mode(s)* OscillatorInterruptFlag[OIF] is clear, indicates main oscillator has reached countdown MCCBCR does not appear to be initialized, meaning beeper-mode is disabled.
==Modifications==

Navigation menu