Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: enable Arduino sketch to select which bitstream to load #3

Open
pdp7 opened this issue Mar 17, 2019 · 2 comments
Open

Comments

@pdp7
Copy link

pdp7 commented Mar 17, 2019

I think it would be nice to make this code more flexible so that it is not hard coded to a single bitstream:
https://github.com/dadamachines/ArduinoCore-samd/blob/master/variants/doppler/ICEClass.h

It would be useful to have different classes for different bitstreams so that the desired functionality can be chosen in the Arduino sketch without have to modify header files in the library.
https://github.com/dadamachines/ArduinoCore-samd/blob/master/variants/doppler/ICEClass.h#L12

#include <doppler_simple_io.h>

which seems to reference:
https://github.com/dadamachines/doppler-FPGA-firmware/blob/master/doppler_simple_io/doppler_simple_io.h

@pdp7
Copy link
Author

pdp7 commented Mar 17, 2019

Note: I am confused how doppler-FPGA-firmware/doppler_simple_io/doppler_simple_io.h ends up on my computer. Maybe that happens when I add the Doppler in the Arduino board manager?

@pdp7
Copy link
Author

pdp7 commented Mar 17, 2019

Here is an example of how I think it would be nice to be able to configure the FPGA from an Arduino sketch. I am assuming this example would be in https://github.com/dadamachines/doppler-software/blob/master/examples/

FPGA configuration to make all the FPGA pins PWM outputs:

#include <ICEClass.h>
PWM_ICEClass ice40pwm;
void setup() { // put your setup code here, to run once:
  ice40pwm.upload(); // Upload BitStream Firmware to FPGA -> see variant.h
  delay(100);
  ice40pwm.initSPI();  // start SPI runtime Link to FPGA

}

void loop() {  // put your main code here, to run repeatedly:
      // code that allows the user to then choose an FPGA pin and set a PWM duty cycle for it
      // maybe something like
      ice40pwm.pinMode(F0, OUTPUT)
      ice40pwm.analogWrite(F0, 255)
  }
}

Maybe the doppler library could come with a set of ICEClass subclasses that would load bitstreams for different functionality. This would let users comfortable with Arduino sketches experiment before diving into Verilog:

  • PWM_ICEClass
  • I2S_ICEClass
  • FMTransmit_ICEClass
  • SynthFilters_ICEClass
  • Servo_ICEClass
  • RotaryEncoder_ICEClass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant