11/13/2022 0 Comments 74hc165 hardware spi atmegaSo see if this is the start of a recognisable sequence and if it is just sit in a loop collecting data bytes from SPDR and using SPM to program them into the code flash (with some error checking hopefully!). However, if it does get set then it probably means that the PC has pulled the AVR's SPI chip select low and transmitted a byte to it. If it doesn't get set then drop out of the bootloader and jump to the main app at 0x0000 (assuming you are happy that there IS a program there!). But now that you have PC based SPI transmit routines working you could definitely use this as a different way to get the data across from the PC to the AVR via bit-banging some parallel port pins.In the AVR you'd want to configure the SPI as a slave rather than master and then at boot time have the bootloader wait for a second or two watching the SPIF bit in SPSR. 99 times out of 100 the chosen communications channel is UART because it's easier on a PC to arrange to output data via that. All a bootloader usually consists of is a program that 'listens' on a communications port for a a recognisable communication sequence inviting it to accept a following stream of binary data and then write this into the program flash of the device.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |