@dc42 I see... I was trying to use the default baud rate of the device I communicate with, which is 57600. I tested with 9600 and it seems much better!
Thank you very much! I would never have thought of such a thing...
Posts made by JoA-RHU
-
RE: UART on expansion board 1LC
-
RE: UART on expansion board 1LC
@dc42 Indeed, this is done in
Platform::InitialiseInterupts
like that:... #elif SAMC21 NVIC_SetPriority(StepTcIRQn, NvicPriorityStep); NVIC_SetPriority(CAN0_IRQn, NvicPriorityCan); # if NUM_SERIAL_PORTS >= 1 NVIC_SetPriority(Serial0_IRQn, NvicPriorityUart); # endif ...
And I've defined
Serial0_IRQn
asSERCOM2_IRQn
. -
UART on expansion board 1LC
Hi,
I'm trying to implement a serial communication on the TOOL1LC firmware (v3.5.3) using pins PA09 and PA12 (io0.in/out). So far, I managed to transmit what I want from the board, but I can't receive proper data and I don't understand why.
Regarding the ports configuration and serial initialization this is what I've done:
void SerialPortInit(AsyncSerial*) noexcept { SetPinFunction(PortAPin(9), GpioPinFunction::D); // Rx on PA09, sercom 2, pad 1 SetPinFunction(PortAPin(12), GpioPinFunction::C); // Tx on PA12, sercom 2, pad 0 } void SerialPortDeinit(AsyncSerial*) noexcept { pinMode(PortAPin(9), PinMode::PIN_MODE_NOT_CONFIGURED); pinMode(PortAPin(12), PinMode::PIN_MODE_NOT_CONFIGURED); } AsyncSerial uart0(2, 1, 128, 128, SerialPortInit, SerialPortDeinit); extern "C" void SERCOM2_Handler() { uart0.Interrupt(); }
Then,
uart0
is used in a handler to send and read data periodically (it is spinning in the heating task, so every 250ms).Sending data works perfectly with method
uart0.write(..)
, but when data isuart0.available()
I get only0s
(null) when Iuart0.read()
.I know uart is officially not supported on expansion boards, but this is the only option I have to communicate with the device I want to use. And I don't have the knowledge to build a completely new expansion board using a SammyC21, in terms of electronics.
Any help or hint would be greatly appreciated.
Thanks -
RE: Can't use iox.in and iox.out as input at the same time
@dc42 I enabled the pullup resistor for the io0.out pin, (and I found out a bad crimping contact for the X endstop... ^^').
Everthing works fine now. Thank you David. -
Can't use iox.in and iox.out as input at the same time
Hi,
I'm using a Duet3 6HC, firmware 3.5.2, and I'd like to use both io0.in and io0.out for X and Y endstops but I can't make it work. I've NC microswitches wired between GND and io0.in/io0_out and my config is the following:M574 X2 S1 P"io0.in" M574 Y2 S1 P"io0.out" M574 Z2 S1 P"io1.in"
For some reason, both inputs are constantly "triggered" (axes name with green background in DWC).
I thought it could be related to the fact that io0 is shared with UART (despite not using it), so I tried on the io1 header but got the same result.Am I missing something? Should I wire the switches differently? Use invertion / pull-up (! ^) ?
Any help would be appreciated. Thank you!