pico_tnc
pico_tnc copied to clipboard
I think tx does not work.
I have tried 3 different Picos and I can decode fine but there is nothing in PWM0 when transmit, have anyone tested ?
Looking through the code it could be it isn't configured correctly - skips TX if any required values are missing.
Thanks @ShawnStoddard I'll check again, but I ended up buying NinoTnc.
Yes, TX works fine. Here is a minimal working example for send.
// The TX pin is GP10 by default!
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include "pico/stdlib.h"
#include "hardware/dma.h"
#include "hardware/pwm.h"
#include "hardware/irq.h"
#include "hardware/sync.h"
#include "hardware/structs/uart.h"
#include "pico/util/queue.h"
#include "hardware/watchdog.h"
#include "tnc.h"
#include "receive.h"
#include "send.h"
#include "ax25.h"
#include "beacon.h"
void setup() {
Serial.begin(115200);
// Core init
tnc_init();
send_init();
}
uint64_t lastMillis;
void loop() {
// watchdog_update();
if (millis() - lastMillis >= 4 * 1000UL) {
lastMillis = millis(); // get ready for the next iteration
tnc_t *tp = &tnc[0];
char *message = (char *)"Hello DE Dhiru here!";
send_packet(tp, (uint8_t *)message, strlen(message));
}
send();
}
@kholia Thank you for checking. I'll test again.