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

Further improvement of the pinout diagrams #276

Merged
merged 7 commits into from
May 13, 2023
Merged

Further improvement of the pinout diagrams #276

merged 7 commits into from
May 13, 2023

Conversation

wollewald
Copy link
Contributor

Now I almost tested every single pin of all the lgt8f328p boards and still found issues / opportunities for improvement. I changed the following:

All boards:

  • have an alternative OC3A output at A0

LQFP48 ("Big Nano style):

  • D35 is a PWM pin and therefor changed to D35~
  • A11 is PCINT31 - that was just missing
  • RST is Arduino Pin28 and not 27

Several changes to the SSOP20 (Pro Mini style) board:

  • To my best knowledge there is not PD0 and PD1.
  • There is no PF1 accordingly (PF2 does exist)

I hope I have not missed any other mistake!

@hmeijdam
Copy link

hmeijdam commented May 13, 2023

I noticed that the SSOP20 pseudo pro-mini pin diagram does not list that the SWD pin can be used as analog input A7

I did not test if the other PE3 features are also available on the PE2/SWD pin. I would not be surprised if they are.

tested with:

const int analogInPin = A7;  // Analog input pin that the potentiometer is attached to
const int analogOutPin = LED_BUILTIN; // Analog output pin that the LED is attached to (in this case a digital pin)

int sensorValue = 0;        // value read from the pot
int outputValue = 0;        // value output to the PWM (analog out)

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
}

void loop() {
  // read the analog in value:
  sensorValue = analogRead(analogInPin);
  // map it to the range of the analog out:
  outputValue = map(sensorValue, 0, 1023, 0, 255);
  // change the analog out value:
  analogWrite(analogOutPin, outputValue);

  // print the results to the Serial Monitor:
  Serial.print("sensor = ");
  Serial.print(sensorValue);
  Serial.print("\t output = ");
  Serial.println(outputValue);

  // wait 2 milliseconds before the next loop for the analog-to-digital
  // converter to settle after the last reading:
  delay(2);
}

@wollewald
Copy link
Contributor Author

@hmeijdam Yes, you are right, and I will also add A6 input for SWC/PE0. Will add both.

@wollewald
Copy link
Contributor Author

Done

@hmeijdam
Copy link

@hmeijdam Yes, you are right, and I will also add A6 input for SWC/PE0. Will add both.

That A6 was a surprise for me as on the LQFP32 it is on PE1, but just tested and can confirm it works.

@wollewald
Copy link
Contributor Author

The pinout of the SSOP20 is overall a bit weird: PF1 is available, but this is not mentioned in the data sheet. OC3A should be available at RESET according to the pinout diagram in the data sheet, but it isn't, even if RESET is changed to a normal I/O pin. TX/RX are available at PD5 / PD6, and there's no PD0 / PD1. A bit confusing.

@dbuezas
Copy link
Owner

dbuezas commented May 13, 2023

Thank you!

@dbuezas dbuezas merged commit ee4a88a into dbuezas:master May 13, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants