If OSCam is connecting to your card OK and the only problem is getting TVHeadend to get the codeword from OSCam then check out my thread and take the relevant parts to configure TVH to talk to OSCam.
https://tvheadend.org/d/3827-what-combination-of-tvh-oscam-are-you-using
In short, there's two parts, setting up OSCam and then setting up TVHeadend;
I use the DVBAPI protocol to link OSCam and TVH - to configure this, copy the below into your oscam.conf file (Files > oscam.conf)
[dvbapi]
enabled = 1
pmt_mode = 0
listen_port = 9001
ecminfo_type = 4
user = tvheadend
read_sdt = 1
boxtype = pc
Next you need to add the tvheadend user referenced above, so copy the below into your oscam.user file (Files > oscam.user)
[account]
user = tvheadend
pwd = tvheadend
monlevel = 4
group = 1
max_connections = 99
Then save and restart OSCam.
Next, move over to TVHeadend and navigate to Configuration > CAs and add a new client with the following parameters;
Enabled: TRUE
Client name: Whatever you like (OSCam will do)
Mode: OSCam net protocol (rev >= 10389)
Camd.socket filename / IP Address (TCP mode): IP Address of the server running OSCam (if it's the same box as the one running TVHeadend, use 127.0.0.1)
Listen / Connect port: 9001
You shouldn't need to restart TVHeadend but it won't hurt, if the icon has changed to a green tick then it's good to go. Otherwise you might need to restart OSCam again and/or check the TVHeadend logs (on my system I did 'tail -f /var/log/syslog' and followed the errors)
This is the minimum required to connect OSCam to TVH and you will probably need to make further changes (in particular to OSCam) to make sure that your card entitlements are updated - I don't use real cards so can't help you with that).
Post back with how you get on.