Go Down

Topic: Problem with the ATTiny25 and Spence Konde core (Read 656 times) previous topic - next topic

pogcarr

OK, I am experiencing a problem that is, no doubt, simply do to my own ignorance.  I am pretty experienced with Arduinos but this is my first foray into ATTiny-land.  I have a sketch that runs fine on a Leonardo, but has a different output if run on the ATTiny.
Code: [Select]
int raw_adc = 128;
void setup() {
Serial.begin(9600);
//  pinMode(3, INPUT);
}

void loop() {
//  raw_adc = analogRead(3);
  Serial.print(raw_adc);        //This line works on an Arduino, but on the ATTiny25 prints a bunch of 8's and spaces!
//  Serial.print("Hello World");     //this line works fine 
  Serial.print(",");
  delay(25);
}


The purpose of the code is to read a voltage and send the value via serial port.  I have commented out the analogRead parts to troubleshoot.  When run on the Leonardo it outputs 128,128,128,128,128... as expected.  On the ATTiny I get a bunch of 8's and blanks!  It would seem that there is something different about how Serial is handled in Spence Konde's core but I just can't figure it out.

Any help is much appreciated!

DrAzzy

#1
Dec 07, 2017, 07:39 am Last Edit: Dec 07, 2017, 07:43 am by DrAzzy
Mysterious. I will investigate.

"Serial" on a tiny x5 with my core (well, actually any serial implementation for tiny x5) is a software implementation, and my cores use a special version that uses the analog comparator interrupt instead of a PCINT to improve library compatibility.

ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

pogcarr

DrAzzy, sorry didn't mean to cross post.  Just wanted to see if anyone here had experienced like problems or could point out some obvious mistake on my part! :-)

Go Up