I can’t get COM1 to work on the Cerbuino Bee modules I have. I can set COM1 in the SerialPort constructor and I can open and I can send bytes to it without errors but nothing appears on pins PB6 & PB7. (UART1)
Is it possible to get this to work as I have developed a plug in board and connected this via X2 and I would hate to have to rework the whole design?
@ Dave McLaughlin - On the Cerb boards, the RX pins from COM1 to COM3 are PC7, PA3, and PB11 and the TX pins are PC6, PA2, and PB10. The UART names on the schematic do not map to COM names.
@ Dave McLaughlin - Only the pins I mentioned in my post are mapped as COM ports. There are no other ports in the firmware. You may be able to configure and use those pins as a COM port using the Register class – potentially by remapping one of the exist COM ports to those pins if possible. It is not something we have tested or know to work however.
Ah, that might be a way to try this. I am not using the I2C on this as this doesn’t work either (using software) as I used the wrong pins so mapping might work.
I’ll dig out the datasheet tomorrow and see if I can do this.
Trying to use the Register class to write to the USART1 registers.
I setup USART6 (COM1) and then read out the values to see what the settings used are and then tried to replicate these (after taking out the interrupt stuff) and I can’t get the values to write to the register. I am using the following to try and write to the SR register.
USART1 is usable via PB6/PB7
You’d need to enable the USART1 clock in APB2 for the registers to work, select AF7 for the pins to mux the signals in AF mode.
USART1 clock probably looks something like this
Register APB2ENR = new GHI.Processor.Register(0x40023844);
APB2ENR.Value = APB2ENR.Value | 0x10;
Thanks clive1, that does indeed allow the registers to work and I managed to transmit data. Just need to figure out how to read it now and not lose any characters as there is no interrupt capability.