enigma Posted December 9, 2011 Report Share Posted December 9, 2011 Hi, I just started using the AVR8 and found it very fun to play with. I would like to know how can I make the AVR8 just output the value of what is received by the uArt? Detail : I would like to have the AVR8 to accept input, form say putty, then output this ASCII output, 8 bits, to pins on the Papilio board. Reason : It will be fun to see as I type in putty how my connected LEDs to my 8 pins flicker in binary as I type in the Putty terminal. I know this should be easy, but I have no idea how to do this, is there standard AVR8 library , functions... to do this? Regards Link to comment Share on other sites More sharing options...
Jack Gassett Posted December 9, 2011 Report Share Posted December 9, 2011 Hey, this sounds like a fun thing to do. The AVR8 and Arduino library should make it real easy to do. Take a look at the page about reading from the serial port at arduino.cc. All we need to do is modify their sample code so that instead of outputting on the serial port we output to a physical port. We can start with this int incomingByte = 0; // for incoming serial data void setup() { Serial.begin(9600); // opens serial port, sets data rate to 9600 bps } void loop() { // send data only when you receive data: if (Serial.available() > 0) { // read the incoming byte: incomingByte = Serial.read(); // say what you got: Serial.print("I received: "); Serial.println(incomingByte, DEC); } } And change it to this: int incomingByte = 0; // for incoming serial data void setup() { Serial.begin(9600); // opens serial port, sets data rate to 9600 bps } void loop() { // send data only when you receive data: if (Serial.available() > 0) { // read the incoming byte: incomingByte = Serial.read(); // say what you got: Serial.print("I received: "); Serial.println(incomingByte, DEC); porta = incomingByte; } } Link to comment Share on other sites More sharing options...
enigma Posted December 9, 2011 Author Report Share Posted December 9, 2011 Hi Jack, Thanks, this is too cool! Also I think you are doing a great job at not just helping them, but to get them to enjoy working with FPGAs! Keep up the excellent work, wish I could give a double thumbs up somehow! Regards Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.