Sounds simple, but I can't get it to work. All it sends is 0's
I know the serial port works because I can add a 'UART_Write(13) and that shows up in Realterm.
I've looked through the help file and the Examples and still can't figure it out...what am I missing?
Here's the test program:
Code: Select all
' *
' * Project name:
' Test3.mbpds
' * Generated by:
' Visual TFT
' * Date of creation
' 6/9/2018
' * Test configuration:
' MCU: P33EP512MU810
' http://www.microchip.com/wwwproducts/Devices.aspx?product=dsPIC33EP512MU810
' Dev.Board: EasyPIC_Fusion_v7_for_dsPIC33EP_9A
' Oscillator: 140000000 Hz
' SW: mikroBasic PRO for dsPIC
' http://www.mikroe.com/mikrobasic/dspic/
' *
program Test3_main
main:
PPS_Mapping(67, _INPUT, _U1RX) 'set TX/RX pin mapping
PPS_MAPPING(65, _OUTPUT, _U1TX)
UART1_Init_Advanced(115200,_UART_8BIT_NOPARITY,_UART_ONE_STOPBIT,_UART_HI_SPEED) 'Initialize serial comm
UART_Set_Active(@UART1_Read, @UART1_Write, @UART1_Data_Ready, @UART1_Tx_Idle) ' set UART1 active
Start_TP()
while TRUE
Check_TP() 'read touchscreen
uart_write(Xcoord) 'send out X and Y pen position for debug
delay_us(100)
uart_write(Ycoord)
delay_us(100)
wend
end.