A toroidal particle-in-cell (PIC) code, suitable for investigating nonlinear phenomena in radio frequency (RF) heating and current drive, is developed and verified thereafter through a series of fidelity tests for field solvers and single particle motions in toroidal geometry, where simulation results show good coincidence with analytical prediction. The RF capability is then demonstrated through the integrated benchmarks with linear lower hybrid wave and ion Bernstein wave theory in cylindrical geometry, where the analytic result is easily available. The frequency and mode structure in the simulations agree well with the theoretical prediction.