ispprog2: keep ISP_RESET (/SS) as output
ISP_RESET is /SS pin of mega328p. In master mode, the /SS pin must be configured as output. If configured as input it must held high to ensure Master SPI operation.
This commit is contained in:
parent
9f98314832
commit
798fa7fbb1
@ -86,13 +86,13 @@
|
|||||||
#define ISP_SCK PORTB5 /* to target */
|
#define ISP_SCK PORTB5 /* to target */
|
||||||
#define RESET_IN PORTB1 /* low active */
|
#define RESET_IN PORTB1 /* low active */
|
||||||
|
|
||||||
#define ISP_INACTIVE() { /* ISP_SCK, ISP_MOSI and ISP_RESET are inputs */ \
|
#define ISP_INACTIVE() { /* ISP_SCK, ISP_MOSI are inputs, set ISP_RESET high */ \
|
||||||
DDRB &= ~((1<<ISP_SCK) | (1<<ISP_MOSI) | (1<<ISP_RESET)); \
|
DDRB &= ~((1<<ISP_SCK) | (1<<ISP_MOSI)); \
|
||||||
PORTB |= (1<<ISP_RESET); \
|
PORTB |= (1<<ISP_RESET); \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ISP_ACTIVE() { /* ISP_SCK, ISP_MOSI and ISP_RESET are outputs, set ISP_RESET low */ \
|
#define ISP_ACTIVE() { /* ISP_SCK, ISP_MOSI and ISP_RESET are outputs, set ISP_RESET low */ \
|
||||||
DDRB |= ((1<<ISP_SCK) | (1<<ISP_MOSI) | (1<<ISP_RESET)); \
|
DDRB |= ((1<<ISP_SCK) | (1<<ISP_MOSI)); \
|
||||||
PORTB &= ~(1<<ISP_RESET); \
|
PORTB &= ~(1<<ISP_RESET); \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user