Oilmex PIC-MT-USB and PIC16F877A
I picked up PIC-MT-USB from Olmex, and have been totally unable to write a PICBASIC program that runs on it.
For starters all I want to do light up the LED.
To add to my embarassment, Olimex even publishes C code and the associated HEX. The hex code runs just fine. I have not been able to figure out how to .. Convert .. the C, or create my own code that can turn on the light.
I am a newbie to MCUs (most of my programming skills are discrete TTL or CMOS), and have one simple project under my belt. This was the next step, but I am stuck.
This is the link to the board: http://www.olimex.com/dev/pic-mt-usb.html
Any experience or help welcome.
Thanks!
Oilmex board now blinks -thanks!
"Be sure to set the configuration to HS, the standard 877A.inc file is set to XT."
So I tired to compile the .inc file. THAT met with failure. Finally removed program(s) and reinstalled. the .inc file I found first was someting completely different.
Finaly, with subborness that is only matched by my ignorance, I stumbled across the .inc file in the PBP directory, and replaced it with the code that was posted in the previous post, and then compiled and ran the code.
Works great.
So, my next quesiton has to do with how do I know when to change configuration from HS to XT?
Clearly my education is lacking.. Pointers to where I can gain wisdom on the configuration files and need to change them would be welcom.
Thanks again!
Robert
Looking for Newbie Book on PIC / PICBASIC
It makes sense that higher speed takes more power, and it's really cool that they built in the functionality to allow making the trade off between speed and power.
If I had an idiot's guide to the .INC file, it might have saved me some head banging.
Anyone recommend a book that covers the subject?
The he code that DaveC3 sent, offers me food for thought, and it enabled me to get my program running. It would be great if I could find a guide that explains each element of each line (sure some of the info is in the device manual), but I am open to literature that might be able to impart wisdom.
Cheers!
Taitny
Mystery sending data through serial port.
On my 4 MHZ dev board I can send serial data just fine.
When I move the chip to the Oilmex board with 20 MHZ clock, I get higher bit characters.
This is what "Hello World" looks Like with coming from the Olimex
The data rate looks to be 2400 baud (based on Oscope), but I can't get normal ASCII out.
åë«::
ú
åë«::
ú
åë«::
ú
åë«::
ú
Here is the code:
' PicBasic Pro program to send a string to the serial port
' the hardware serial port
'DEFINE OSC 4 'Works fine with a 4 MHZ system
DEFINE OSC 20
'on a 4 MHZ system it sends out data at 480 Baud just fine
DEFINE HSER_BAUD 2400 ' Select the baud rate
'Sends out high order bits on 20 MHZ system
loop:
Hserout ["Hello World", 13, 10] ' Send text followed by carriage return and linefeed
pause 1000
Goto loop ' Do it all over again
End
Any suggestion on what i need to do to fix this strange output?
Thanks!
Mystery sending data through serial port - DO'H
Dave - it does NOT have the Max chip. The LAB-X1 DOES have the Max..
I will ponder the ramificions of this.. I suspect setting parity to -1 is not the answer. Seemed to recall somehting about Invert in the compiler book .
I went back to the book "Since the sereal transmission is sdone in hardware, it is not possible to set the levels to an invertes state to eleminate an RS-232 driver"
I read that several times.. Suddenly it has meaning!
It's got a FT232RL, wich convers USB to RS-232, no doubt with the right state. I tapped in after the chip directly to the MCU.
Lookse like I need to add the MAX232, or switch development boards, although if you have a magic bullet, I am willing to listen..
Thanks!
Robert