A man cultivated 12 cannabis plants in his home with potential to yield £5,000 worth of the drug, a court heard.
Gerald Donaldson, 48, pleaded guilty at Jedburgh Sheriff Court to committing that offence at his Borthwick Road home in Hawick on November 28 last year.
He also admitted possession of the class-B drug.
Procurator fiscal Graham Fraser said police discovered two distinct growing areas in the house made up of five plants and seven seedlings.
He said: “The potential value of these were significant.”
The fiscal added that 10 grammes of herbal cannabis were also recovered and valued at £200.
Defence lawyer Ed Hulme said his client grew the drug for medicinal purposes.
He explained: “At the end of the day, it is clearly someone growing cannabis for their own personal use and nothing more.
“He grew his own rather than funding drug-dealers.
“He won’t be growing any more cannabis. His experience of cannabis has been positive for medicinal purposes.
“He was growing it for his own personal use but has breached the law.”
Donaldson was ordered to carry out 150 hours’ unpaid work as an alternative to a custodial sentence
Sheriff Peter Paterson told him: “Whatever your views are, society determines it remains a criminal offence.”