This may help, it's from a previous post.
1998 avalon Programming instructions for Toyota Avalon Remote with the following ID.
FCC ID: HYQ 1512 Y
CAN: 1551 102 578
RSS - 210
DENSO
1. Open driver's door.
2. Insert and remove key from ignition.
3. Cycle power door locks on-off 5 times.
4. Close the door and open it again.
5. Cycle door locks 5 times again.
6. Insert the key and turn it to ON - OFF - ON - OFF and remove.
You will hear the locks cycle.
7. After that, press BOTH Lock and Unlock buttons of the remote together
at the same time, then push the one button with the bump on it. (Lock)
If the door locks cycle ONCE, you're done.
If they cycle twice, it didn't take..... Just push the buttons (Step 7) again.
If you wait too long between steps you'll have to start over again.
IMPORTANT NOTE:
If you are ADDING a second remote you must repeat Step 7 on the other remote
right after the first remote is done so they both obtain the same code.