Commit ee29fda2 authored by Alan Wood's avatar Alan Wood

Added Uart back to pc

parent 45f840b3
......@@ -24,8 +24,10 @@
/* RCC_OscInitStruct.PLL.PLLP = 7; // PLLSAI3 clock = 27.4 MHz (192 MHz / 7)
/* RCC_OscInitStruct.PLL.PLLQ = 4; // USB clock (PLL48M1) = 48 MHz (192 MHz / 4) --> OK for USB
/* RCC_OscInitStruct.PLL.PLLR = 4; // PLL clock = 48 MHz (192 MHz / 4)
#define EXTCLK
*/
#define EXTCLK
MyStorm ms(PB_5, PB_4, PB_3, PB_7, PB_6, PD_2,PA_15);
......@@ -38,20 +40,30 @@ int main() {
#ifdef EXTCLK
SystemCoreClockUpdate();
#endif
Serial pc(PA_9,PA_10);
pc.baud(115200);
//Serial pc(USBTX,USBRX);
pc.printf("Loading Ice image\n\r");
//Lets get the bit image size
uint32_t len = &_binary_bitmap_bin_end - &_binary_bitmap_bin_start;
//Initialise anfd program Ice40
ms.ice_prog(&_binary_bitmap_bin_start, len);
pc.printf("Ice configured\n\r");
wait_ms(10);
//Lets light up some leds!
pc.printf("LED sequence\n\r");
// Light em up one by one
for(uint8_t i = 0 ; i < 4; i++) {
ms.ice_reg_write(i, 255);
wait(1);
}
pc.printf("LED PWM sweep\n\r");
// Lets sweep them
while(1) {
for(uint8_t i = 0 ; i < 4; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment