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
Support other microcontrollers than ATmega328p #5
Comments
Would you like to add a transistor? |
I think I did not understand your question. Will a transistor help in supporting other µCs? |
Yes. An analog comparator becomes unnecessary. |
Ah I see, thanks for the hint. This circuit also has the benefit that it does not need a pin for reference voltage. Would be great to get this working, hope I can build the circuit this week. Unfortunately there is also a downside: this will break compatibility with existing shields/boards ( I could not find any with transistor built-in). Meaning this probably would require some documentation and a new major release. |
I got SoftModem onto the Leonardo (ATmega32u4), and sending, but not receiving (as noted) using @rmeister's https://github.com/rmeister/SoftModem/tree/attiny-support. What would it take to get receiving working? I'd like to contribute but am not sure exactly where to start. Thank you! |
I think that additional circuitry is necessary to support SoftModem. |
ATmega32U4 has Analog Comparator. AIN+ can be connected either to the AIN0 (PE6) pin, or to the internal If analogRead is unnecessary, make the following connection. If you need analogRead, make the following connection. For more detail see 2.3 Analog Comparator |
Thanks! I'm not familiar enough with electronics to help on a circuitry change at this point, but I looked up what an analog comparator is, which was a good first step for me: |
Just wanted to let you know that I have implemented the circuit shown above http://cyberworks.cocolog-nifty.com/blog/files/modem_mono.pdf and it worked fine on Atmega328. The only exception is that a 100R resistor was replaced by 1K resistor. Analog comparator interrupt handler is replaced by a regular interrupt triggered on RISING. However SoftModem currently does not work on attiny85, at least on 16Mhz using internal PLL oscillator. Sending kind of works after I replaced timer output with manual port switching and _delay_us(), but with sync errors: sending anything longer than five characters is impossible as the sequence gets corrupted. With default timers it doesn't work at all, even though it sounds like normal. And receiving doesn't work at all, even though the same softmodem works on 328P (with transistor). |
e.g. ATtiny85, ATmega32u4.
We already began doing some stuff in this direction: publiclab/webjack#17
I managed to get the library sending on the ATtiny with Timer0. The problem with receiving is, that Timer0 uses the same pins as the analog comparator.
A solution could be the ADC multiplexer, which allows to replace AIN1 with an arbitrary ADC input pin. The downside of this solution is, that none of the other ADC pins can be used then, as the ADC has to be disabled.
It would be perfect if Timer1 can be used instead of Timer0. But I did not have the time yet to look closely at the differences between the timers.
For the ATmega32u4 the ADC definitively has to be switched off, otherwise it can only use the internal bandgap reference as negative comparator input.
The text was updated successfully, but these errors were encountered: