Skip to content
Snippets Groups Projects
Commit c90fe755 authored by Jake Read's avatar Jake Read
Browse files

final board check is good

parent 536d6194
Branches
No related tags found
No related merge requests found
...@@ -499,7 +499,9 @@ int main (void) ...@@ -499,7 +499,9 @@ int main (void)
} }
``` ```
OK, I finally got all ports to write to their TX lines. This after some confusing bitwise or-ing of registers OK, I finally got all ports to write to their TX lines. This after some confusing bitwise or-ing of registers.
I'm going to check that all of the lights are on OK pins, and then call this, do the updates and get the big batch of boards out to fab.
## Incremental ## Incremental
...@@ -516,6 +518,8 @@ OK, I finally got all ports to write to their TX lines. This after some confusin ...@@ -516,6 +518,8 @@ OK, I finally got all ports to write to their TX lines. This after some confusin
- *maybe* flip or double MK header for standoff momentary happiness? - *maybe* flip or double MK header for standoff momentary happiness?
- LEDS are too bright - LEDS are too bright
- tag-connect w/ clips would be nice - tag-connect w/ clips would be nice
- disconnect or solder jumper usb data lines
- definitely go for a reset button
order order
- 1k 0805 - 1k 0805
......
circuit/images/all-leds-on.jpg

409 KiB

File added
circuit/images/all-uart-lines.jpg

197 KiB

No preview for this file type
No preview for this file type
...@@ -36,20 +36,28 @@ pin_t stlb; ...@@ -36,20 +36,28 @@ pin_t stlb;
pin_t stlr; pin_t stlr;
pin_t button; pin_t button;
pin_t p1lr;
pin_t p1lg;
pin_t p1lb;
pin_t p2lr;
pin_t p2lg;
pin_t p2lb;
pin_t p3lr; pin_t p3lr;
pin_t p3lg;
pin_t p3lb;
pin_t p4lr;
pin_t p4lg;
pin_t p4lb;
tinyport_t tp1; tinyport_t tp1;
tinyport_t tp2; tinyport_t tp2;
tinyport_t tp3; tinyport_t tp3;
tinyport_t tp4; tinyport_t tp4;
int main (void) void peripheralsetup(void){
{
/* Insert system clock initialization code here (sysclk_init()). */
board_init();
sysclk_init();
PMC->PMC_PCER0 = 1 << ID_PIOA; PMC->PMC_PCER0 = 1 << ID_PIOA;
PMC->PMC_PCER0 = 1 << ID_PIOD; PMC->PMC_PCER0 = 1 << ID_PIOD;
PMC->PMC_PCER0 = 1 << ID_UART0; // UART0 PMC->PMC_PCER0 = 1 << ID_UART0; // UART0
...@@ -82,20 +90,74 @@ int main (void) ...@@ -82,20 +90,74 @@ int main (void)
//PIOD->PIO_ABCDSR[0] = ~PIO_PER_P19; //PIOD->PIO_ABCDSR[0] = ~PIO_PER_P19;
PIOD->PIO_ABCDSR[1] |= PIO_PER_P18; PIOD->PIO_ABCDSR[1] |= PIO_PER_P18;
PIOD->PIO_ABCDSR[1] |= PIO_PER_P19; PIOD->PIO_ABCDSR[1] |= PIO_PER_P19;
}
void setupstatus(void){
p3lr = pin_new(PIOD, PIO_PER_P10);
pin_output(&p3lr);
stlb = pin_new(PIOA, PIO_PER_P1); stlb = pin_new(PIOA, PIO_PER_P1);
pin_output(&stlb); pin_output(&stlb);
stlr = pin_new(PIOD, PIO_PER_P11); stlr = pin_new(PIOD, PIO_PER_P11);
pin_output(&stlr); pin_output(&stlr);
button = pin_new(PIOA, PIO_PER_P15); button = pin_new(PIOA, PIO_PER_P15);
pin_input(&button); pin_input(&button);
p1lr = pin_new(PIOA, PIO_PER_P22);
pin_output(&p1lr);
p1lg = pin_new(PIOA, PIO_PER_P8);
pin_output(&p1lg);
p1lb = pin_new(PIOA, PIO_PER_P13);
pin_output(&p1lb);
p2lr = pin_new(PIOA, PIO_PER_P30);
pin_output(&p2lr);
p2lg = pin_new(PIOD, PIO_PER_P9);
pin_output(&p2lg);
p2lb = pin_new(PIOA, PIO_PER_P28);
pin_output(&p2lb);
p3lr = pin_new(PIOD, PIO_PER_P10);
pin_output(&p3lr);
p3lg = pin_new(PIOA, PIO_PER_P0);
pin_output(&p3lg);
p3lb = pin_new(PIOD, PIO_PER_P15);
pin_output(&p3lb);
p4lr = pin_new(PIOD, PIO_PER_P13);
pin_output(&p4lr);
p4lg = pin_new(PIOD, PIO_PER_P14);
pin_output(&p4lg);
p4lb = pin_new(PIOA, PIO_PER_P27);
pin_output(&p4lb);
}
void clearallstatus(void){
pin_clear(&p1lr);
pin_clear(&p1lg);
pin_clear(&p1lb);
pin_clear(&p2lr);
pin_clear(&p2lg);
pin_clear(&p2lb);
pin_clear(&p3lr);
pin_clear(&p3lg);
pin_clear(&p3lb);
pin_clear(&p4lr);
pin_clear(&p4lg);
pin_clear(&p4lb);
}
int main (void)
{
/* Insert system clock initialization code here (sysclk_init()). */
board_init();
sysclk_init();
peripheralsetup();
setupstatus();
tp1 = tinyport_new(UART2, PIOD, PERIPHERAL_C, PIO_PER_P25, PIO_PER_P26); tp1 = tinyport_new(UART2, PIOD, PERIPHERAL_C, PIO_PER_P25, PIO_PER_P26);
tp2 = tinyport_new(UART0, PIOA, PERIPHERAL_A, PIO_PER_P9, PIO_PER_P10); tp2 = tinyport_new(UART0, PIOA, PERIPHERAL_A, PIO_PER_P9, PIO_PER_P10);
tp3 = tinyport_new(UART1, PIOA, PERIPHERAL_C, PIO_PER_P5, PIO_PER_P4); tp3 = tinyport_new(UART1, PIOA, PERIPHERAL_C, PIO_PER_P5, PIO_PER_P4);
...@@ -110,16 +172,14 @@ int main (void) ...@@ -110,16 +172,14 @@ int main (void)
if(pin_get_state(&button)){ // hi, button is not pressed if(pin_get_state(&button)){ // hi, button is not pressed
pin_clear(&stlb); pin_clear(&stlb);
pin_set(&stlr); pin_set(&stlr);
pin_clear(&p3lr); clearallstatus();
tp_putchar(&tp1, 85); tp_putchar(&tp1, 85);
tp_putchar(&tp2, 85); tp_putchar(&tp2, 85);
tp_putchar(&tp3, 85); tp_putchar(&tp3, 85);
tp_putchar(&tp4, 85); tp_putchar(&tp4, 85);
pin_set(&p3lr);
} else { } else {
pin_set(&stlb); pin_set(&stlb);
pin_clear(&stlr); pin_clear(&stlr);
pin_set(&p3lr);
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment