Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

18F usb code

Status
Not open for further replies.

chancelier

New Member
Hi everyone,..
i am interfacing nokia 2700 modem with a 18F455 to send sms via usb port.
the mobile supports at commands in text mode
My only problem is:
How to write the AT-commands in mikroC language?
what is the library to use?

For example:
AT+CMGF=1 --> This command will activate text mode.

I want to know how to translate this command into mikroC.?

help please

regards
 
Last edited:
hi evryone
please i want an answer .
which library i use ?
is it usb HID or what?
how can i do that ?
come on its not very difficult i guess
 
As far as I know, the PIC18 family can be USB devices but not USB hosts. It sounds like you are wanting to use the PIC as the host and the modem as the device - I don't know if you can do that using the firmware provided by MicroChip; there may be the appropriate libraries around, but I think at all use the PIC24 or PIC32 family devices to be embedded hosts.

That said, if you can send any character string through an interface then you should have no issue just because that character string is an AT-command. If the interfaces works at a byte level, then simply set up a pointer to the start of the string and pass a character at a time, updating the pointer until you reach the terminating null. If the interface has a library interface that allows you to pass a string, the simply pass the pointer to the start of the string to the library function. The only 'trick' I can think of is that some libraries require that you don't release the string buffer until after all of the characters have been sent which means it is up to you to place the characters into a static, global or some other type of memory that you know will stay around long enough (typically NOT a local variable within a function that you exist before the interface has sent the entire string).

Susan
 
hi Susan

thanks a lot for you response , it made many things more clear for me.
as you said 18F cannot be a usb embedded host it can be only a device...
but can i make it a usb host with a max3421 IC?

one other question: can i use this max3421 with a 16F family microcontroller (since the max 3421 has an spi interface)?
 
That is really a design decision you will need to make for yourself after reading the various data sheets and understanding your goals and requirements.

Susan
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top