Site icon Renzo Mischianti

Problems using atmega328p without bootloader & hardware serial

hello! I am trying to make a project using atmega328p progframmed directly via USBASP from arduino environment and using an E32-433t20d module as the radio. i am trying to use the hardware serial without any luck and also I have this weird thing going on that the AUX input pin that i declare shows 5V instead of 0, wich leads me to think that it is not declared as an input in the library maybe? or most likely, i am not passing the right arguments to the initializer function... can someone point me in the right direction please? thank you so much!! /* * LoRa E32-TTL-100 * Set configuration. * http://mischianti.org/lora-e32-device-for-arduino-esp32-or-esp8266-configuration-part-3/ * * E32-TTL-100----- Arduino UNO * M0 ----- 3.3v * M1 ----- 3.3v * TX ----- PIN 2 (PullUP) * RX ----- PIN 3 (PullUP & Voltage divider) * AUX ----- Not connected * VCC ----- 3.3v/5v * GND ----- GND * */ #include "Arduino.h" #include "LoRa_E32.h" LoRa_E32 e32ttl100(Serial, 2, 8, 9, 9600); // e32 TX e32 RX // Hardware serial, AUX pin, M0, M1, Baudrate void printParameters(struct Configuration configuration); void printModuleInformation(struct ModuleInformation moduleInformation); void setup() { //Serial.begin(9600); delay(500); // Startup all pins and UART e32ttl100.begin(); ResponseStructContainer c; c = e32ttl100.getConfiguration(); // It's important get configuration pointer before all other operation Configuration configuration = *(Configuration*) c.data; c.status.getResponseDescription(); //printParameters(configuration); configuration.ADDL = 0x0; configuration.ADDH = 0x1; configuration.CHAN = 0x19; configuration.OPTION.fec = FEC_0_OFF; configuration.OPTION.fixedTransmission = FT_TRANSPARENT_TRANSMISSION; configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS; configuration.OPTION.transmissionPower = POWER_17; configuration.OPTION.wirelessWakeupTime = WAKE_UP_1250; configuration.SPED.airDataRate = AIR_DATA_RATE_011_48; configuration.SPED.uartBaudRate = UART_BPS_115200; configuration.SPED.uartParity = MODE_00_8N1; // Set configuration changed and set to not hold the configuration ResponseStatus rs = e32ttl100.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE); rs.getResponseDescription(); //printParameters(configuration); c.close(); } void loop() { }  
Exit mobile version